diff --git a/spa/meson.build b/spa/meson.build index 84e4486ea..82e274e9f 100644 --- a/spa/meson.build +++ b/spa/meson.build @@ -54,7 +54,13 @@ if get_option('spa-plugins').allowed() summary({'aptX': aptx_dep.found()}, bool_yn: true, section: 'Bluetooth audio codecs') fdk_aac_dep = dependency('fdk-aac', required : get_option('bluez5-codec-aac')) summary({'AAC': fdk_aac_dep.found()}, bool_yn: true, section: 'Bluetooth audio codecs') - lc3plus_dep = cc.find_library('LC3plus', has_headers: ['lc3.h'], required : get_option('bluez5-codec-lc3plus')) + lc3plus_dep = dependency('lc3plus', required : false) + if not lc3plus_dep.found() + lc3plus_lc3plus_h_dep = cc.find_library('LC3plus', has_headers: ['lc3plus.h'], required : get_option('bluez5-codec-lc3plus')) + if lc3plus_lc3plus_h_dep.found() + lc3plus_dep = declare_dependency(compile_args : '-DHAVE_LC3PLUS_H', dependencies : [ lc3plus_lc3plus_h_dep ]) + endif + endif summary({'LC3plus': lc3plus_dep.found()}, bool_yn: true, section: 'Bluetooth audio codecs') endif avcodec_dep = dependency('libavcodec', required: get_option('ffmpeg')) diff --git a/spa/plugins/bluez5/a2dp-codec-lc3plus.c b/spa/plugins/bluez5/a2dp-codec-lc3plus.c index bd798cfc1..b50c94746 100644 --- a/spa/plugins/bluez5/a2dp-codec-lc3plus.c +++ b/spa/plugins/bluez5/a2dp-codec-lc3plus.c @@ -34,7 +34,11 @@ #include #include +#ifdef HAVE_LC3PLUS_H +#include +#else #include +#endif #include "rtp.h" #include "a2dp-codecs.h" diff --git a/spa/plugins/bluez5/meson.build b/spa/plugins/bluez5/meson.build index 365c36f37..03f986b37 100644 --- a/spa/plugins/bluez5/meson.build +++ b/spa/plugins/bluez5/meson.build @@ -110,7 +110,7 @@ if ldac_dep.found() install_dir : spa_plugindir / 'bluez5') endif -if lc3plus_dep.found() +if get_option('bluez5-codec-lc3plus').allowed() and lc3plus_dep.found() lc3plus_args = codec_args lc3plus_dep = [ lc3plus_dep ] bluez_codec_lc3plus = shared_library('spa-codec-bluez5-lc3plus',