From e953bb3238259b49d66527d5884c6d26b8ca5a74 Mon Sep 17 00:00:00 2001 From: Huang-Huang Bao Date: Fri, 28 May 2021 20:53:37 +0800 Subject: [PATCH] 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. --- spa/meson.build | 12 +++++++----- spa/plugins/meson.build | 4 +++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/spa/meson.build b/spa/meson.build index 712caf126..263af4c25 100644 --- a/spa/meson.build +++ b/spa/meson.build @@ -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')) diff --git a/spa/plugins/meson.build b/spa/plugins/meson.build index 80cb89bce..c54304f39 100644 --- a/spa/plugins/meson.build +++ b/spa/plugins/meson.build @@ -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