summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-11-04 12:21:23 +0100
committerMax Kellermann <max@musicpd.org>2018-11-04 12:21:23 +0100
commit86f1074905ffce25ff5d8e74fc5701f24b36823b (patch)
tree2918d4f00c144bf1c31c76fe4725c257da8d0e39 /src/lib
parent8e66b855a3539654e48dd0b3ca7bad234427f2ca (diff)
lib/xiph/meson.build: the Vorbis encoder requires the Vorbis decoder
Without the Vorbis decoder, `libvorbis` is never detected, leading to linker failures when attempting to build the Vorbis encoder.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/xiph/meson.build13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/xiph/meson.build b/src/lib/xiph/meson.build
index 19dc64300..a5d6c1929 100644
--- a/src/lib/xiph/meson.build
+++ b/src/lib/xiph/meson.build
@@ -2,10 +2,15 @@ libflac_dep = dependency('flac', version: '>= 1.2', required: get_option('flac')
libopus_dep = dependency('opus', required: get_option('opus'))
libvorbis_dep = dependency('vorbis', required: get_option('vorbis'))
-if need_encoder
- libvorbisenc_dep = dependency('vorbisenc', required: get_option('vorbisenc'))
-else
- libvorbisenc_dep = dependency('', required: false)
+libvorbisenc_dep = dependency('', required: false)
+if need_encoder and not get_option('vorbisenc').disabled()
+ if libvorbis_dep.found()
+ libvorbisenc_dep = dependency('vorbisenc', required: get_option('vorbisenc'))
+ elif get_option('vorbisenc').enabled()
+ error('Cannot build the Vorbis encoder without the Vorbis decoder')
+ else
+ message('Disabling the Vorbis encoder because the Vorbis decoder is disabled as well')
+ endif
endif
if libopus_dep.found() or libvorbis_dep.found() or libvorbisenc_dep.found()