treewide: meson.build: use feature.allowed()

Since meson 0.59.0, a feature object has an `allowed()`
method which returns true when the feature is set to
'enabled' or 'auto'.

Utilize that instead of the previously used

  not feature.disabled()
This commit is contained in:
Barnabás Pőcze 2022-02-03 19:14:34 +01:00
parent 15e7a61aa7
commit cc73053512
10 changed files with 35 additions and 35 deletions

View file

@ -6,12 +6,12 @@ foreach dep: bluez5_deps
endforeach
cdata.set('HAVE_BLUEZ_5_BACKEND_NATIVE',
not get_option('bluez5-backend-hsp-native').disabled() or
not get_option('bluez5-backend-hfp-native').disabled())
cdata.set('HAVE_BLUEZ_5_BACKEND_HSP_NATIVE', not get_option('bluez5-backend-hsp-native').disabled())
cdata.set('HAVE_BLUEZ_5_BACKEND_HFP_NATIVE', not get_option('bluez5-backend-hfp-native').disabled())
cdata.set('HAVE_BLUEZ_5_BACKEND_OFONO', not get_option('bluez5-backend-ofono').disabled())
cdata.set('HAVE_BLUEZ_5_BACKEND_HSPHFPD', not get_option('bluez5-backend-hsphfpd').disabled())
get_option('bluez5-backend-hsp-native').allowed() or
get_option('bluez5-backend-hfp-native').allowed())
cdata.set('HAVE_BLUEZ_5_BACKEND_HSP_NATIVE', get_option('bluez5-backend-hsp-native').allowed())
cdata.set('HAVE_BLUEZ_5_BACKEND_HFP_NATIVE', get_option('bluez5-backend-hfp-native').allowed())
cdata.set('HAVE_BLUEZ_5_BACKEND_OFONO', get_option('bluez5-backend-ofono').allowed())
cdata.set('HAVE_BLUEZ_5_BACKEND_HSPHFPD', get_option('bluez5-backend-hsphfpd').allowed())
cdata.set('HAVE_BLUEZ_5_HCI', dependency('bluez', version: '< 6', required: false).found())
bluez5_sources = [
@ -34,18 +34,18 @@ bluez5_data = ['bluez-hardware.conf']
install_data(bluez5_data, install_dir : spa_datadir / 'bluez5')
if not get_option('bluez5-backend-hsp-native').disabled() or not get_option('bluez5-backend-hfp-native').disabled()
if get_option('bluez5-backend-hsp-native').allowed() or get_option('bluez5-backend-hfp-native').allowed()
if libusb_dep.found()
bluez5_deps += libusb_dep
endif
bluez5_sources += ['backend-native.c']
endif
if not get_option('bluez5-backend-ofono').disabled()
if get_option('bluez5-backend-ofono').allowed()
bluez5_sources += ['backend-ofono.c']
endif
if not get_option('bluez5-backend-hsphfpd').disabled()
if get_option('bluez5-backend-hsphfpd').allowed()
bluez5_sources += ['backend-hsphfpd.c']
endif