meson: Make bluez optional

I can't promise that the logic is *exactly* the same as the logic
currently in use with the autotools, but it seems correct to me.

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
This commit is contained in:
Arnaud Rebillout 2018-10-19 17:40:06 +07:00 committed by Arun Raghavan
parent d984da3fea
commit ab5e5fe5c6
4 changed files with 37 additions and 29 deletions

View file

@ -8,12 +8,13 @@ libbluez5_util_headers = [
'rtp.h',
]
if bluez_dep.found()
if get_option('bluez5-native-headset')
libbluez5_util_sources += [ 'backend-native.c' ]
endif
# TODO This should be optional
libbluez5_util_sources += [ 'backend-ofono.c' ]
if get_option('bluez5-ofono-headset')
libbluez5_util_sources += [ 'backend-ofono.c' ]
endif
libbluez5_util = shared_library('libbluez5_util',
libbluez5_util_sources,

View file

@ -103,6 +103,16 @@ if avahi_dep.found()
]
endif
if bluez_dep.found()
subdir('bluetooth')
all_modules += [
[ 'module-bluetooth-discover', 'bluetooth/module-bluetooth-discover.c' ],
[ 'module-bluetooth-policy', 'bluetooth/module-bluetooth-policy.c', [], [], [dbus_dep] ],
[ 'module-bluez5-device', 'bluetooth/module-bluez5-device.c', [], [], [sbc_dep], libbluez5_util ],
[ 'module-bluez5-discover', 'bluetooth/module-bluez5-discover.c', [], [], [dbus_dep], libbluez5_util ],
]
endif
if dbus_dep.found()
all_modules += [
[ 'module-console-kit', 'module-console-kit.c', [], [], [dbus_dep] ],
@ -130,20 +140,6 @@ if dbus_dep.found() and fftw_dep.found()
]
endif
if dbus_dep.found() and sbc_dep.found()
all_modules += [
[ 'module-bluetooth-discover', 'bluetooth/module-bluetooth-discover.c' ],
[ 'module-bluetooth-policy', 'bluetooth/module-bluetooth-policy.c', [], [], [dbus_dep] ]
]
if bluez_dep.found()
subdir('bluetooth')
all_modules += [
[ 'module-bluez5-device', 'bluetooth/module-bluez5-device.c', [], [], [sbc_dep], libbluez5_util ],
[ 'module-bluez5-discover', 'bluetooth/module-bluez5-discover.c', [], [], [dbus_dep], libbluez5_util ],
]
endif
endif
if jack_dep.found()
all_modules += [
[ 'module-jack-sink', 'jack/module-jack-sink.c', [], [], [jack_dep] ],