2021-04-15 11:39:49 +08:00
|
|
|
bluez5_deps = [ mathlib, dbus_dep, sbc_dep, bluez_dep ]
|
2021-03-10 15:36:27 -03:00
|
|
|
foreach dep: bluez5_deps
|
|
|
|
|
if not dep.found()
|
|
|
|
|
subdir_done()
|
|
|
|
|
endif
|
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
|
|
if not get_option('bluez5-backend-hsp-native').disabled()
|
|
|
|
|
cdata.set('HAVE_BLUEZ_5_BACKEND_HSP_NATIVE', 1)
|
|
|
|
|
cdata.set('HAVE_BLUEZ_5_BACKEND_NATIVE', 1)
|
|
|
|
|
endif
|
|
|
|
|
if not get_option('bluez5-backend-hfp-native').disabled()
|
|
|
|
|
cdata.set('HAVE_BLUEZ_5_BACKEND_HFP_NATIVE', 1)
|
|
|
|
|
cdata.set('HAVE_BLUEZ_5_BACKEND_NATIVE', 1)
|
|
|
|
|
endif
|
|
|
|
|
if not get_option('bluez5-backend-ofono').disabled()
|
|
|
|
|
cdata.set('HAVE_BLUEZ_5_BACKEND_OFONO', 1)
|
|
|
|
|
endif
|
|
|
|
|
if not get_option('bluez5-backend-hsphfpd').disabled()
|
|
|
|
|
cdata.set('HAVE_BLUEZ_5_BACKEND_HSPHFPD', 1)
|
|
|
|
|
endif
|
2018-01-11 10:23:37 +01:00
|
|
|
|
|
|
|
|
bluez5_sources = ['plugin.c',
|
2019-05-16 13:18:45 +02:00
|
|
|
'a2dp-codecs.c',
|
2020-10-19 12:12:21 +02:00
|
|
|
'a2dp-codec-sbc.c',
|
2018-01-11 10:23:37 +01:00
|
|
|
'a2dp-sink.c',
|
2019-04-19 13:26:07 -04:00
|
|
|
'a2dp-source.c',
|
2019-07-31 12:11:56 -04:00
|
|
|
'sco-sink.c',
|
|
|
|
|
'sco-source.c',
|
2020-12-23 15:10:04 +02:00
|
|
|
'sco-io.c',
|
2018-11-26 12:18:53 +01:00
|
|
|
'bluez5-device.c',
|
2020-07-22 14:50:38 +02:00
|
|
|
'bluez5-dbus.c']
|
|
|
|
|
|
2020-12-03 09:25:05 +01:00
|
|
|
bluez5_args = [ '-D_GNU_SOURCE' ]
|
|
|
|
|
|
|
|
|
|
if ldac_dep.found()
|
|
|
|
|
bluez5_sources += [ 'a2dp-codec-ldac.c' ]
|
|
|
|
|
bluez5_args += [ '-DENABLE_LDAC' ]
|
|
|
|
|
bluez5_deps += ldac_dep
|
2020-12-19 08:21:40 +08:00
|
|
|
if ldac_abr_dep.found()
|
|
|
|
|
bluez5_args += [ '-DENABLE_LDAC_ABR' ]
|
|
|
|
|
bluez5_deps += ldac_abr_dep
|
|
|
|
|
endif
|
2020-12-03 09:25:05 +01:00
|
|
|
endif
|
2020-12-04 11:34:38 +01:00
|
|
|
if aptx_dep.found()
|
|
|
|
|
bluez5_sources += [ 'a2dp-codec-aptx.c' ]
|
|
|
|
|
bluez5_args += [ '-DENABLE_APTX' ]
|
|
|
|
|
bluez5_deps += aptx_dep
|
|
|
|
|
endif
|
2020-12-22 12:39:56 +01:00
|
|
|
if fdk_aac_dep.found()
|
|
|
|
|
bluez5_sources += [ 'a2dp-codec-aac.c' ]
|
|
|
|
|
bluez5_args += [ '-DENABLE_AAC' ]
|
|
|
|
|
bluez5_deps += fdk_aac_dep
|
|
|
|
|
endif
|
2020-12-03 09:25:05 +01:00
|
|
|
|
2021-03-10 15:36:27 -03:00
|
|
|
if not get_option('bluez5-backend-hsp-native').disabled() or not get_option('bluez5-backend-hfp-native').disabled()
|
2021-01-04 15:50:03 +01:00
|
|
|
bluez5_sources += ['backend-native.c']
|
2020-07-22 14:50:38 +02:00
|
|
|
endif
|
|
|
|
|
|
2021-03-10 15:36:27 -03:00
|
|
|
if not get_option('bluez5-backend-ofono').disabled()
|
2020-07-22 14:50:38 +02:00
|
|
|
bluez5_sources += ['backend-ofono.c']
|
|
|
|
|
endif
|
2018-01-11 10:23:37 +01:00
|
|
|
|
2021-03-10 15:36:27 -03:00
|
|
|
if not get_option('bluez5-backend-hsphfpd').disabled()
|
2020-07-22 17:40:32 +02:00
|
|
|
bluez5_sources += ['backend-hsphfpd.c']
|
|
|
|
|
endif
|
|
|
|
|
|
2018-01-11 10:23:37 +01:00
|
|
|
bluez5lib = shared_library('spa-bluez5',
|
|
|
|
|
bluez5_sources,
|
2020-07-22 14:50:38 +02:00
|
|
|
include_directories : [ spa_inc, configinc ],
|
2020-12-03 09:25:05 +01:00
|
|
|
c_args : bluez5_args,
|
|
|
|
|
dependencies : bluez5_deps,
|
2018-01-11 10:23:37 +01:00
|
|
|
install : true,
|
2021-04-15 14:41:04 +10:00
|
|
|
install_dir : spa_plugindir / 'bluez5')
|