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

@ -19,7 +19,7 @@ manpages = [
'pw-profiler.1.rst.in', 'pw-profiler.1.rst.in',
] ]
if not get_option('pipewire-jack').disabled() if get_option('pipewire-jack').allowed()
manpages += 'pw-jack.1.rst.in' manpages += 'pw-jack.1.rst.in'
endif endif

View file

@ -336,7 +336,7 @@ endforeach
gst_dp_found = gst_dep.length() > 0 gst_dp_found = gst_dep.length() > 0
summary({'gstreamer-device-provider': gst_dp_found}, bool_yn: true, section: 'Backend') summary({'gstreamer-device-provider': gst_dp_found}, bool_yn: true, section: 'Backend')
cdata.set('HAVE_GSTREAMER_DEVICE_PROVIDER', not get_option('gstreamer-device-provider').disabled()) cdata.set('HAVE_GSTREAMER_DEVICE_PROVIDER', get_option('gstreamer-device-provider').allowed())
webrtc_dep = dependency('webrtc-audio-processing', webrtc_dep = dependency('webrtc-audio-processing',
version : ['>= 0.2', '< 1.0'], version : ['>= 0.2', '< 1.0'],
@ -382,10 +382,10 @@ cdata.set('HAVE_LILV', lilv_lib.found())
installed_tests_metadir = pipewire_datadir / 'installed-tests' / pipewire_name installed_tests_metadir = pipewire_datadir / 'installed-tests' / pipewire_name
installed_tests_execdir = pipewire_libexecdir / 'installed-tests' / pipewire_name installed_tests_execdir = pipewire_libexecdir / 'installed-tests' / pipewire_name
installed_tests_enabled = not get_option('installed_tests').disabled() installed_tests_enabled = get_option('installed_tests').allowed()
installed_tests_template = files('template.test.in') installed_tests_template = files('template.test.in')
if not get_option('tests').disabled() if get_option('tests').allowed()
gstack = find_program('gstack', required : false) gstack = find_program('gstack', required : false)
cdata.set('HAVE_GSTACK', gstack.found()) cdata.set('HAVE_GSTACK', gstack.found())
endif endif
@ -394,17 +394,17 @@ subdir('po')
subdir('spa') subdir('spa')
subdir('src') subdir('src')
if not get_option('tests').disabled() if get_option('tests').allowed()
subdir('test') subdir('test')
endif endif
configure_file(output : 'config.h', configure_file(output : 'config.h',
configuration : cdata) configuration : cdata)
if not get_option('pipewire-jack').disabled() if get_option('pipewire-jack').allowed()
subdir('pipewire-jack') subdir('pipewire-jack')
endif endif
if not get_option('pipewire-v4l2').disabled() if get_option('pipewire-v4l2').allowed()
subdir('pipewire-v4l2') subdir('pipewire-v4l2')
endif endif
@ -415,7 +415,7 @@ if alsa_dep.found()
endif endif
generate_manpages = false generate_manpages = false
if not get_option('man').disabled() if get_option('man').allowed()
rst2man = find_program('rst2man', required: false) rst2man = find_program('rst2man', required: false)
if not rst2man.found() if not rst2man.found()
rst2man = find_program('rst2man.py', required: get_option('man')) rst2man = find_program('rst2man.py', required: get_option('man'))

View file

@ -31,7 +31,7 @@ pkgconfig.generate(filebase : 'lib@0@'.format(spa_name),
subdir('include') subdir('include')
if not get_option('spa-plugins').disabled() if get_option('spa-plugins').allowed()
udevrulesdir = get_option('udevrulesdir') udevrulesdir = get_option('udevrulesdir')
if udevrulesdir == '' if udevrulesdir == ''
# absolute path, otherwise meson prepends the prefix # absolute path, otherwise meson prepends the prefix
@ -74,6 +74,6 @@ endif
subdir('tools') subdir('tools')
subdir('tests') subdir('tests')
if not get_option('examples').disabled() if get_option('examples').allowed()
subdir('examples') subdir('examples')
endif endif

View file

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

View file

@ -1,16 +1,16 @@
if alsa_dep.found() if alsa_dep.found()
subdir('alsa') subdir('alsa')
endif endif
if not get_option('audioconvert').disabled() if get_option('audioconvert').allowed()
subdir('audioconvert') subdir('audioconvert')
endif endif
if not get_option('audiomixer').disabled() if get_option('audiomixer').allowed()
subdir('audiomixer') subdir('audiomixer')
endif endif
if not get_option('control').disabled() if get_option('control').allowed()
subdir('control') subdir('control')
endif endif
if not get_option('audiotestsrc').disabled() if get_option('audiotestsrc').allowed()
subdir('audiotestsrc') subdir('audiotestsrc')
endif endif
if bluez_dep.found() if bluez_dep.found()
@ -22,19 +22,19 @@ endif
if jack_dep.found() if jack_dep.found()
subdir('jack') subdir('jack')
endif endif
if not get_option('support').disabled() if get_option('support').allowed()
subdir('support') subdir('support')
endif endif
if not get_option('test').disabled() if get_option('test').allowed()
subdir('test') subdir('test')
endif endif
if not get_option('videoconvert').disabled() if get_option('videoconvert').allowed()
subdir('videoconvert') subdir('videoconvert')
endif endif
if not get_option('videotestsrc').disabled() if get_option('videotestsrc').allowed()
subdir('videotestsrc') subdir('videotestsrc')
endif endif
if not get_option('volume').disabled() if get_option('volume').allowed()
subdir('volume') subdir('volume')
endif endif
if vulkan_headers if vulkan_headers

View file

@ -23,7 +23,7 @@ spa_support_lib = shared_library('spa-support',
install_dir : spa_plugindir / 'support') install_dir : spa_plugindir / 'support')
spa_support_dep = declare_dependency(link_with: spa_support_lib) spa_support_dep = declare_dependency(link_with: spa_support_lib)
if not get_option('evl').disabled() if get_option('evl').allowed()
evl_inc = include_directories('/usr/evl/include') evl_inc = include_directories('/usr/evl/include')
evl_lib = cc.find_library('evl', evl_lib = cc.find_library('evl',
dirs: ['/usr/evl/lib/'], dirs: ['/usr/evl/lib/'],

View file

@ -1,6 +1,6 @@
if not get_option('systemd-system-service').disabled() if get_option('systemd-system-service').allowed()
subdir('system') subdir('system')
endif endif
if not get_option('systemd-user-service').disabled() if get_option('systemd-user-service').allowed()
subdir('user') subdir('user')
endif endif

View file

@ -8,7 +8,7 @@ pipewire_gst_sources = [
'gstpipewiresrc.c', 'gstpipewiresrc.c',
] ]
if not get_option('gstreamer-device-provider').disabled() if get_option('gstreamer-device-provider').allowed()
pipewire_gst_sources += [ 'gstpipewiredeviceprovider.c' ] pipewire_gst_sources += [ 'gstpipewiredeviceprovider.c' ]
endif endif

View file

@ -3,10 +3,10 @@ subdir('pipewire')
subdir('daemon') subdir('daemon')
subdir('tools') subdir('tools')
subdir('modules') subdir('modules')
if not get_option('examples').disabled() if get_option('examples').allowed()
subdir('examples') subdir('examples')
endif endif
if not get_option('tests').disabled() if get_option('tests').allowed()
subdir('tests') subdir('tests')
endif endif

View file

@ -34,7 +34,7 @@ if ncurses_dep.found()
endif endif
build_pw_cat = false build_pw_cat = false
if not get_option('pw-cat').disabled() and sndfile_dep.found() if get_option('pw-cat').allowed() and sndfile_dep.found()
build_pw_cat = true build_pw_cat = true
pwcat_sources = [ pwcat_sources = [