meson: fix build if bluez5 option is disabled

Don't look up codecs dependencies and don't include 'bluez5' subdir if 'bluez5' option is disabled or libbluetooth is not found.
See https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/707.
This commit is contained in:
Huang-Huang Bao 2021-05-28 20:53:37 +08:00
parent 38bcec9022
commit e953bb3238
No known key found for this signature in database
GPG key ID: 33C3271387A13D1B
2 changed files with 10 additions and 6 deletions

View file

@ -19,11 +19,13 @@ if not get_option('spa-plugins').disabled()
# plugin-specific dependencies
alsa_dep = dependency('alsa', required: get_option('alsa'))
bluez_dep = dependency('bluez', version : '>= 4.101', required: get_option('bluez5'))
sbc_dep = dependency('sbc', required: get_option('bluez5'))
ldac_dep = dependency('ldacBT-enc', required : get_option('bluez5').enabled() and get_option('bluez5-codec-ldac'))
ldac_abr_dep = dependency('ldacBT-abr', required : get_option('bluez5').enabled() and get_option('bluez5-codec-ldac'))
aptx_dep = dependency('libopenaptx', version : '< 0.2.1', required : get_option('bluez5').enabled() and get_option('bluez5-codec-aptx'))
fdk_aac_dep = dependency('fdk-aac', required : get_option('bluez5').enabled() and get_option('bluez5-codec-aac'))
if bluez_dep.found()
sbc_dep = dependency('sbc', required: get_option('bluez5'))
ldac_dep = dependency('ldacBT-enc', required : get_option('bluez5-codec-ldac'))
ldac_abr_dep = dependency('ldacBT-abr', required : get_option('bluez5-codec-ldac'))
aptx_dep = dependency('libopenaptx', version : '< 0.2.1', required : get_option('bluez5-codec-aptx'))
fdk_aac_dep = dependency('fdk-aac', required : get_option('bluez5-codec-aac'))
endif
avcodec_dep = dependency('libavcodec', required: get_option('ffmpeg'))
jack_dep = dependency('jack', version : '>= 1.9.10', required: get_option('jack'))
vulkan_dep = dependency('vulkan', disabler : true, version : '>= 1.1.69', required: get_option('vulkan'))

View file

@ -13,7 +13,9 @@ endif
if not get_option('audiotestsrc').disabled()
subdir('audiotestsrc')
endif
subdir('bluez5')
if bluez_dep.found()
subdir('bluez5')
endif
if avcodec_dep.found()
subdir('ffmpeg')
endif