meson: Use feature options everywhere it makes sense

This commit is contained in:
Thibault Saunier 2021-03-10 15:36:27 -03:00 committed by Wim Taymans
parent 98bedb3895
commit 485bae5eb0
20 changed files with 211 additions and 224 deletions

View file

@ -11,7 +11,7 @@ task:
build_script: build_script:
- mkdir build - mkdir build
- cd build - cd build
- meson setup -Dalsa=false -Dpipewire-alsa=false -Dbluez5=false -Djack=false -Dpipewire-jack=false -Dpipewire-pulseaudio=false -Dv4l2=false -Dsystemd=false .. - meson setup -Dalsa=disabled -Dpipewire-alsa=disabled -Dbluez5=disabled -Djack=disabled -Dpipewire-jack=disabled -Dpipewire-pulseaudio=disabled -Dv4l2=disabled -Dsystemd=disabled ..
- ninja - ninja
test_script: test_script:
- cd build - cd build

View file

@ -54,15 +54,15 @@ include:
- export XDG_RUNTIME_DIR="$(mktemp -p $PWD -d xdg-runtime-XXXXXX)" - export XDG_RUNTIME_DIR="$(mktemp -p $PWD -d xdg-runtime-XXXXXX)"
script: script:
- meson "$BUILD_DIR" . --prefix="$PREFIX" - meson "$BUILD_DIR" . --prefix="$PREFIX"
-Ddocs=true -Ddocs=enabled
-Dinstalled_tests=true -Dinstalled_tests=enabled
-Dsystemd-system-service=true -Dsystemd-system-service=enabled
-Dbluez5-backend-hsphfpd=true -Dbluez5-backend-hsphfpd=enabled
-Daudiotestsrc=true -Daudiotestsrc=enabled
-Dtest=true -Dtest=enabled
-Dvideotestsrc=true -Dvideotestsrc=enabled
-Dvolume=true -Dvolume=enabled
-Dvulkan=true -Dvulkan=enabled
-Dsdl2=enabled -Dsdl2=enabled
-Dsndfile=enabled -Dsndfile=enabled
- ninja -C "$BUILD_DIR" - ninja -C "$BUILD_DIR"

View file

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

View file

@ -171,7 +171,7 @@ elif cc.links(
dependencies : libatomic, dependencies : libatomic,
name : '8-byte __atomic_store_n with libatomic') name : '8-byte __atomic_store_n with libatomic')
atomic_dep = libatomic atomic_dep = libatomic
elif get_option('pipewire-jack') elif get_option('pipewire-jack').enabled()
# Currently only required for the JACK backend # Currently only required for the JACK backend
error('8-byte atomic operations are required for pipewire-jack') error('8-byte atomic operations are required for pipewire-jack')
endif endif
@ -277,43 +277,12 @@ if cc.has_function('getrandom', prefix : '#include <sys/random.h>')
cdata.set('HAVE_GETRANDOM', 1) cdata.set('HAVE_GETRANDOM', 1)
endif endif
if get_option('systemd') systemd = dependency('systemd', required: get_option('systemd'))
systemd = dependency('systemd', required: false) systemd_dep = dependency('libsystemd',required: get_option('systemd'))
systemd_dep = dependency('libsystemd', required: false) if systemd.found() and systemd_dep.found()
if systemd.found() and systemd_dep.found() cdata.set('HAVE_SYSTEMD', 1)
cdata.set('HAVE_SYSTEMD', 1)
else
warning('systemd integration was enabled, but systemd is not available')
endif
endif endif
if get_option('bluez5')
if get_option('bluez5-backend-hsp-native')
cdata.set('HAVE_BLUEZ_5_BACKEND_HSP_NATIVE', 1)
cdata.set('HAVE_BLUEZ_5_BACKEND_NATIVE', 1)
endif
if get_option('bluez5-backend-hfp-native')
cdata.set('HAVE_BLUEZ_5_BACKEND_HFP_NATIVE', 1)
cdata.set('HAVE_BLUEZ_5_BACKEND_NATIVE', 1)
endif
if get_option('bluez5-backend-ofono')
cdata.set('HAVE_BLUEZ_5_BACKEND_OFONO', 1)
endif
if get_option('bluez5-backend-hsphfpd')
cdata.set('HAVE_BLUEZ_5_BACKEND_HSPHFPD', 1)
endif
endif
if get_option('gstreamer')
if get_option('gstreamer-device-provider')
cdata.set('HAVE_GSTREAMER_DEVICE_PROVIDER', 1)
endif
endif
configure_file(input : 'config.h.meson',
output : 'config.h',
configuration : cdata)
configinc = include_directories('.') configinc = include_directories('.')
pipewire_inc = include_directories('src') pipewire_inc = include_directories('src')
@ -341,19 +310,35 @@ sdl_dep = dependency('sdl2', required : get_option('sdl2'))
ncurses_dep = dependency('ncurses', required : false) ncurses_dep = dependency('ncurses', required : false)
sndfile_dep = dependency('sndfile', version : '>= 1.0.20', required : get_option('sndfile')) sndfile_dep = dependency('sndfile', version : '>= 1.0.20', required : get_option('sndfile'))
if get_option('gstreamer') gst_option = get_option('gstreamer')
glib_dep = dependency('glib-2.0', version : '>=2.32.0') gst_deps_def = {
endif 'glib-2.0': {'version': '>=2.32.0'},
'gobject-2.0': {},
'gmodule-2.0': {},
'gio-2.0': {},
'gio-unix-2.0': {},
'gstreamer-1.0': {'version': '>= 1.10.0'},
'gstreamer-plugins-base-1.0': {},
'gstreamer-video-1.0': {},
'gstreamer-audio-1.0': {},
'gstreamer-allocators-1.0': {},
}
if get_option('gstreamer') gst_dep = []
gobject_dep = dependency('gobject-2.0') foreach depname, kwargs: gst_deps_def
gmodule_dep = dependency('gmodule-2.0') dep = dependency(depname, required: gst_option, kwargs: kwargs)
gio_dep = [dependency('gio-2.0'), dependency('gio-unix-2.0')] if not dep.found()
gst_dep = [dependency('gstreamer-1.0', version : '>= 1.10.0'), gst_dep = []
dependency('gstreamer-plugins-base-1.0'), if get_option('gstreamer-device-provider').enabled()
dependency('gstreamer-video-1.0'), error('`gstreamer-device-provider` is enabled but `@0@` was not found.'.format(depname))
dependency('gstreamer-audio-1.0'), endif
dependency('gstreamer-allocators-1.0'),] break
endif
gst_dep += [dep]
endforeach
if not get_option('gstreamer-device-provider').disabled()
cdata.set('HAVE_GSTREAMER_DEVICE_PROVIDER', 1)
endif endif
# On FreeBSD, epoll-shim library is required for eventfd() and timerfd() # On FreeBSD, epoll-shim library is required for eventfd() and timerfd()
@ -365,44 +350,38 @@ libinotify_dep = (build_machine.system() == 'freebsd'
? dependency('libinotify', required: true) ? dependency('libinotify', required: true)
: dependency('', required: false)) : dependency('', required: false))
alsa_dep = (get_option('pipewire-alsa') alsa_dep = dependency('alsa', version : '>=1.1.7', required: get_option('pipewire-alsa'))
? dependency('alsa', version : '>=1.1.7')
: dependency('', required: false))
installed_tests_metadir = join_paths(pipewire_datadir, 'installed-tests', pipewire_name) installed_tests_metadir = join_paths(pipewire_datadir, 'installed-tests', pipewire_name)
installed_tests_execdir = join_paths(pipewire_libexecdir, 'installed-tests', pipewire_name) installed_tests_execdir = join_paths(pipewire_libexecdir, 'installed-tests', pipewire_name)
installed_tests_enabled = get_option('installed_tests') installed_tests_enabled = not get_option('installed_tests').disabled()
installed_tests_template = files('template.test.in') installed_tests_template = files('template.test.in')
subdir('po') subdir('po')
subdir('spa') subdir('spa')
subdir('src') subdir('src')
if get_option('pipewire-jack') configure_file(input : 'config.h.meson',
output : 'config.h',
configuration : cdata)
if not get_option('pipewire-jack').disabled()
subdir('pipewire-jack') subdir('pipewire-jack')
endif endif
if get_option('pipewire-alsa') if not get_option('pipewire-alsa').disabled()
subdir('pipewire-alsa/alsa-plugins') subdir('pipewire-alsa/alsa-plugins')
subdir('pipewire-alsa/conf') subdir('pipewire-alsa/conf')
endif endif
if get_option('docs') doxygen = find_program('doxygen', required : get_option('docs'))
doxygen = find_program('doxygen', required : false) if doxygen.found()
if doxygen.found() subdir('doc')
subdir('doc')
else
warning('Documentation was enabled, but doxygen is not available')
endif
endif endif
if get_option('man') xmltoman = find_program('xmltoman', required : get_option('man'))
xmltoman = find_program('xmltoman', required : false) if xmltoman.found()
if xmltoman.found() subdir('man')
subdir('man')
else
warning('Man page generation was enabled, but xmltoman is not available')
endif
endif endif
setenv = find_program('pw-uninstalled.sh') setenv = find_program('pw-uninstalled.sh')

View file

@ -1,154 +1,155 @@
option('docs', option('docs',
description: 'Build documentation', description: 'Build documentation',
type: 'boolean', type: 'feature',
value: false) value: 'disabled')
option('examples', option('examples',
description: 'Build examples', description: 'Build examples',
type: 'boolean', type: 'feature',
value: true) value: 'enabled')
option('media-session', option('media-session',
description: 'Build and install pipewire-media-session', description: 'Build and install pipewire-media-session',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('man', option('man',
description: 'Build manpages', description: 'Build manpages',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('tests', option('tests',
description: 'Build tests', description: 'Build tests',
type: 'boolean', type: 'feature',
value: true) value: 'auto',
yield : true)
option('installed_tests', option('installed_tests',
description: 'Install manual and automated test executables', description: 'Install manual and automated test executables',
type: 'boolean', type: 'feature',
value: false) value: 'disabled')
option('gstreamer', option('gstreamer',
description: 'Build GStreamer plugins', description: 'Build GStreamer plugins',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('gstreamer-device-provider', option('gstreamer-device-provider',
description: 'Build GStreamer device provider plugin', description: 'Build GStreamer device provider plugin',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('systemd', option('systemd',
description: 'Enable systemd integration', description: 'Enable systemd integration',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('systemd-system-service', option('systemd-system-service',
description: 'Install systemd system service file', description: 'Install systemd system service file',
type: 'boolean', type: 'feature',
value: false) value: 'auto')
option('systemd-user-service', option('systemd-user-service',
description: 'Install systemd user service file', description: 'Install systemd user service file',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('pipewire-alsa', option('pipewire-alsa',
description: 'Enable pipewire-alsa integration', description: 'Enable pipewire-alsa integration',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('pipewire-jack', option('pipewire-jack',
description: 'Enable pipewire-jack integration', description: 'Enable pipewire-jack integration',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('libjack-path', option('libjack-path',
description: 'Where to install the libjack.so library', description: 'Where to install the libjack.so library',
type: 'string') type: 'string')
option('spa-plugins', option('spa-plugins',
description: 'Enable spa plugins integration', description: 'Enable spa plugins integration',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('alsa', option('alsa',
description: 'Enable alsa spa plugin integration', description: 'Enable alsa spa plugin integration',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('audiomixer', option('audiomixer',
description: 'Enable audiomixer spa plugin integration', description: 'Enable audiomixer spa plugin integration',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('audioconvert', option('audioconvert',
description: 'Enable audioconvert spa plugin integration', description: 'Enable audioconvert spa plugin integration',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('bluez5', option('bluez5',
description: 'Enable bluez5 spa plugin integration', description: 'Enable bluez5 spa plugin integration',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('bluez5-backend-hsp-native', option('bluez5-backend-hsp-native',
description: 'Enable HSP in native backend in bluez5 spa plugin', description: 'Enable HSP in native backend in bluez5 spa plugin',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('bluez5-backend-hfp-native', option('bluez5-backend-hfp-native',
description: 'Enable HFP in native backend in bluez5 spa plugin', description: 'Enable HFP in native backend in bluez5 spa plugin',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('bluez5-backend-ofono', option('bluez5-backend-ofono',
description: 'Enable oFono HFP backend in bluez5 spa plugin', description: 'Enable oFono HFP backend in bluez5 spa plugin',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('bluez5-backend-hsphfpd', option('bluez5-backend-hsphfpd',
description: 'Enable hsphfpd backend in bluez5 spa plugin', description: 'Enable hsphfpd backend in bluez5 spa plugin',
type: 'boolean', type: 'feature',
value: false) value: 'auto')
option('control', option('control',
description: 'Enable control spa plugin integration', description: 'Enable control spa plugin integration',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('audiotestsrc', option('audiotestsrc',
description: 'Enable audiotestsrc spa plugin integration', description: 'Enable audiotestsrc spa plugin integration',
type: 'boolean', type: 'feature',
value: false) value: 'auto')
option('ffmpeg', option('ffmpeg',
description: 'Enable ffmpeg spa plugin integration', description: 'Enable ffmpeg spa plugin integration',
type: 'boolean', type: 'feature',
value: false) value: 'disabled')
option('jack', option('jack',
description: 'Enable jack spa plugin integration', description: 'Enable jack spa plugin integration',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('support', option('support',
description: 'Enable support spa plugin integration', description: 'Enable support spa plugin integration',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('evl', option('evl',
description: 'Enable EVL support spa plugin integration', description: 'Enable EVL support spa plugin integration',
type: 'boolean', type: 'feature',
value: false) value: 'disabled')
option('test', option('test',
description: 'Enable test spa plugin integration', description: 'Enable test spa plugin integration',
type: 'boolean', type: 'feature',
value: false) value: 'disabled')
option('v4l2', option('v4l2',
description: 'Enable v4l2 spa plugin integration', description: 'Enable v4l2 spa plugin integration',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('libcamera', option('libcamera',
description: 'Enable libcamera spa plugin integration', description: 'Enable libcamera spa plugin integration',
type: 'boolean', type: 'boolean',
value: false) value: false)
option('videoconvert', option('videoconvert',
description: 'Enable videoconvert spa plugin integration', description: 'Enable videoconvert spa plugin integration',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('videotestsrc', option('videotestsrc',
description: 'Enable videotestsrc spa plugin integration', description: 'Enable videotestsrc spa plugin integration',
type: 'boolean', type: 'feature',
value: false) value: 'auto')
option('volume', option('volume',
description: 'Enable volume spa plugin integration', description: 'Enable volume spa plugin integration',
type: 'boolean', type: 'feature',
value: false) value: 'auto')
option('vulkan', option('vulkan',
description: 'Enable vulkan spa plugin integration', description: 'Enable vulkan spa plugin integration',
type: 'boolean', type: 'feature',
value: false) value: 'auto')
option('pw-cat', option('pw-cat',
description: 'Build pw-cat/pw-play/pw-record', description: 'Build pw-cat/pw-play/pw-record',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('udev', option('udev',
description: 'Enable Udev integration', description: 'Enable Udev integration',
type: 'boolean', type: 'feature',
value: true) value: 'auto')
option('udevrulesdir', option('udevrulesdir',
type : 'string', type : 'string',
description : 'Directory for udev rules (defaults to /lib/udev/rules.d)') description : 'Directory for udev rules (defaults to /lib/udev/rules.d)')

View file

@ -6,7 +6,7 @@ if sdl_dep.found()
install : installed_tests_enabled, install : installed_tests_enabled,
install_dir : join_paths(installed_tests_execdir, 'examples', 'spa')) install_dir : join_paths(installed_tests_execdir, 'examples', 'spa'))
if get_option('libcamera') and libcamera_dep.found() if libcamera_dep.found()
executable('local-libcamera', 'local-libcamera.c', executable('local-libcamera', 'local-libcamera.c',
include_directories : [configinc, spa_inc], include_directories : [configinc, spa_inc],
c_args : ['-D_GNU_SOURCE'], c_args : ['-D_GNU_SOURCE'],

View file

@ -9,7 +9,7 @@ spa_inc = include_directories('include')
subdir('include') subdir('include')
if get_option('spa-plugins') if not get_option('spa-plugins').disabled()
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
@ -17,42 +17,28 @@ if get_option('spa-plugins')
endif endif
# common dependencies # common dependencies
if get_option('alsa') or get_option('v4l2') libudev_dep = dependency('libudev', required: get_option('alsa').enabled() or get_option('v4l2').enabled() or get_option('udev').enabled())
libudev_dep = dependency('libudev')
endif
# plugin-specific dependencies # plugin-specific dependencies
if get_option('alsa') alsa_dep = dependency('alsa', required: get_option('alsa'))
alsa_dep = dependency('alsa') bluez_dep = dependency('bluez', version : '>= 4.101', required: get_option('bluez5'))
endif sbc_dep = dependency('sbc', required: get_option('bluez5'))
if get_option('bluez5') ldac_dep = dependency('ldacBT-enc', required : false)
bluez_dep = dependency('bluez', version : '>= 4.101') ldac_abr_dep = dependency('ldacBT-abr', required : false)
sbc_dep = dependency('sbc') aptx_dep = dependency('libopenaptx', required : false)
ldac_dep = dependency('ldacBT-enc', required : false) fdk_aac_dep = dependency('fdk-aac', required : false)
ldac_abr_dep = dependency('ldacBT-abr', required : false) avcodec_dep = dependency('libavcodec', required: get_option('ffmpeg'))
aptx_dep = dependency('libopenaptx', required : false) avformat_dep = dependency('libavformat', required: get_option('ffmpeg'))
fdk_aac_dep = dependency('fdk-aac', required : false) jack_dep = dependency('jack', version : '>= 1.9.10', required: get_option('jack'))
endif vulkan_dep = dependency('vulkan', version : '>= 1.1.69', required: get_option('vulkan'))
if get_option('ffmpeg') libcamera_dep = dependency('camera', required: get_option('libcamera'))
avcodec_dep = dependency('libavcodec')
avformat_dep = dependency('libavformat')
endif
if get_option('jack')
jack_dep = dependency('jack', version : '>= 1.9.10')
endif
if get_option('vulkan')
vulkan_dep = dependency('vulkan', version : '>= 1.1.69')
endif
if get_option('libcamera')
libcamera_dep = dependency('camera')
endif
subdir('plugins') subdir('plugins')
endif endif
subdir('tools') subdir('tools')
subdir('tests') subdir('tests')
if get_option('examples') if not get_option('examples').disabled()
subdir('examples') subdir('examples')
endif endif

View file

@ -42,7 +42,7 @@ executable('test-timer',
install : false, install : false,
) )
if get_option('udev') and libudev_dep.found() if libudev_dep.found()
install_data(alsa_udevrules, install_data(alsa_udevrules,
install_dir : udevrulesdir, install_dir : udevrulesdir,
) )

View file

@ -1,3 +1,24 @@
bluez5_deps = [ dbus_dep, sbc_dep, bluez_dep ]
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
bluez5_sources = ['plugin.c', bluez5_sources = ['plugin.c',
'a2dp-codecs.c', 'a2dp-codecs.c',
@ -11,7 +32,6 @@ bluez5_sources = ['plugin.c',
'bluez5-dbus.c'] 'bluez5-dbus.c']
bluez5_args = [ '-D_GNU_SOURCE' ] bluez5_args = [ '-D_GNU_SOURCE' ]
bluez5_deps = [ dbus_dep, sbc_dep, bluez_dep ]
if ldac_dep.found() if ldac_dep.found()
bluez5_sources += [ 'a2dp-codec-ldac.c' ] bluez5_sources += [ 'a2dp-codec-ldac.c' ]
@ -33,15 +53,15 @@ if fdk_aac_dep.found()
bluez5_deps += fdk_aac_dep bluez5_deps += fdk_aac_dep
endif endif
if get_option('bluez5-backend-hsp-native') or get_option('bluez5-backend-hfp-native') if not get_option('bluez5-backend-hsp-native').disabled() or not get_option('bluez5-backend-hfp-native').disabled()
bluez5_sources += ['backend-native.c'] bluez5_sources += ['backend-native.c']
endif endif
if get_option('bluez5-backend-ofono') if not get_option('bluez5-backend-ofono').disabled()
bluez5_sources += ['backend-ofono.c'] bluez5_sources += ['backend-ofono.c']
endif endif
if get_option('bluez5-backend-hsphfpd') if not get_option('bluez5-backend-hsphfpd').disabled()
bluez5_sources += ['backend-hsphfpd.c'] bluez5_sources += ['backend-hsphfpd.c']
endif endif

View file

@ -1,48 +1,46 @@
if get_option('alsa') if alsa_dep.found()
subdir('alsa') subdir('alsa')
endif endif
if get_option('audioconvert') if not get_option('audioconvert').disabled()
subdir('audioconvert') subdir('audioconvert')
endif endif
if get_option('audiomixer') if not get_option('audiomixer').disabled()
subdir('audiomixer') subdir('audiomixer')
endif endif
if get_option('control') if not get_option('control').disabled()
subdir('control') subdir('control')
endif endif
if get_option('audiotestsrc') if not get_option('audiotestsrc').disabled()
subdir('audiotestsrc') subdir('audiotestsrc')
endif endif
if get_option('bluez5') subdir('bluez5')
subdir('bluez5') if avcodec_dep.found() and avformat_dep.found()
endif
if get_option('ffmpeg')
subdir('ffmpeg') subdir('ffmpeg')
endif endif
if get_option('jack') if jack_dep.found()
subdir('jack') subdir('jack')
endif endif
if get_option('support') if not get_option('support').disabled()
subdir('support') subdir('support')
endif endif
if get_option('test') if not get_option('test').disabled()
subdir('test') subdir('test')
endif endif
if get_option('videoconvert') if not get_option('videoconvert').disabled()
subdir('videoconvert') subdir('videoconvert')
endif endif
if get_option('videotestsrc') if not get_option('videotestsrc').disabled()
subdir('videotestsrc') subdir('videotestsrc')
endif endif
if get_option('volume') if not get_option('volume').disabled()
subdir('volume') subdir('volume')
endif endif
if get_option('vulkan') if vulkan_dep.found()
subdir('vulkan') subdir('vulkan')
endif endif
if get_option('v4l2') if libudev_dep.found() and not get_option('v4l2').disabled()
subdir('v4l2') subdir('v4l2')
endif endif
if get_option('libcamera') if libcamera_dep.found()
subdir('libcamera') subdir('libcamera')
endif endif

View file

@ -15,10 +15,10 @@ spa_support_lib = shared_library('spa-support',
install_dir : join_paths(spa_plugindir, 'support')) install_dir : join_paths(spa_plugindir, 'support'))
if get_option('evl') if not get_option('evl').disabled()
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/'], required: get_option('evl'))
spa_evl_sources = ['evl-system.c', spa_evl_sources = ['evl-system.c',
'evl-plugin.c'] 'evl-plugin.c']
@ -42,7 +42,7 @@ spa_dbus_lib = shared_library('spa-dbus',
install_dir : join_paths(spa_plugindir, 'support')) install_dir : join_paths(spa_plugindir, 'support'))
if get_option('systemd') and systemd_dep.found() if systemd_dep.found()
spa_journal_sources = ['journal.c'] spa_journal_sources = ['journal.c']
spa_journal_lib = shared_library('spa-journal', spa_journal_lib = shared_library('spa-journal',

View file

@ -77,9 +77,9 @@ executable('pipewire-pulse',
# ) # )
#endif #endif
if get_option('media-session') if not get_option('media-session').disabled()
subdir('media-session.d') subdir('media-session.d')
endif endif
if get_option('systemd') and systemd.found() if systemd.found()
subdir('systemd') subdir('systemd')
endif endif

View file

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

View file

@ -12,7 +12,7 @@ configure_file(input : 'pipewire.service.in',
configuration : systemd_config, configuration : systemd_config,
install_dir : systemd_system_services_dir) install_dir : systemd_system_services_dir)
if get_option('media-session') if not get_option('media-session').disabled()
configure_file(input : 'pipewire-media-session.service.in', configure_file(input : 'pipewire-media-session.service.in',
output : 'pipewire-media-session.service', output : 'pipewire-media-session.service',
configuration : systemd_config, configuration : systemd_config,

View file

@ -22,7 +22,7 @@ configure_file(input : 'pipewire-pulse.service.in',
configuration : systemd_config, configuration : systemd_config,
install_dir : systemd_user_services_dir) install_dir : systemd_user_services_dir)
if get_option('media-session') if not get_option('media-session').disabled()
configure_file(input : 'pipewire-media-session.service.in', configure_file(input : 'pipewire-media-session.service.in',
output : 'pipewire-media-session.service', output : 'pipewire-media-session.service',
configuration : systemd_config, configuration : systemd_config,

View file

@ -65,7 +65,7 @@ executable('export-spa-device',
dependencies : [pipewire_dep, mathlib], dependencies : [pipewire_dep, mathlib],
) )
if get_option('media-session') and alsa_dep.found() if alsa_dep.found()
executable('pipewire-media-session', executable('pipewire-media-session',
'media-session/access-flatpak.c', 'media-session/access-flatpak.c',
'media-session/access-portal.c', 'media-session/access-portal.c',
@ -94,6 +94,8 @@ if get_option('media-session') and alsa_dep.found()
install: true, install: true,
dependencies : [dbus_dep, pipewire_dep, alsa_dep, mathlib], dependencies : [dbus_dep, pipewire_dep, alsa_dep, mathlib],
) )
elif get_option('media-session').enabled() and not alsa_dep.found()
error('`media-session` is enabled but required dependency `alsa` not found.')
endif endif
executable('pw-reserve', executable('pw-reserve',

View file

@ -8,7 +8,7 @@ pipewire_gst_sources = [
'gstpipewiresrc.c', 'gstpipewiresrc.c',
] ]
if get_option('gstreamer-device-provider') if not get_option('gstreamer-device-provider').disabled()
pipewire_gst_sources += [ 'gstpipewiredeviceprovider.c' ] pipewire_gst_sources += [ 'gstpipewiredeviceprovider.c' ]
endif endif
@ -31,7 +31,9 @@ pipewire_gst = shared_library('gstpipewire',
pipewire_gst_sources, pipewire_gst_sources,
c_args : pipewire_gst_c_args, c_args : pipewire_gst_c_args,
include_directories : [configinc, spa_inc], include_directories : [configinc, spa_inc],
dependencies : [gobject_dep, glib_dep, gio_dep, gst_dep, pipewire_dep], dependencies : [gst_dep, pipewire_dep],
install : true, install : true,
install_dir : '@0@/gstreamer-1.0'.format(get_option('libdir')), install_dir : '@0@/gstreamer-1.0'.format(get_option('libdir')),
) )
plugins = [pipewire_gst]

View file

@ -4,13 +4,11 @@ subdir('extensions')
subdir('daemon') subdir('daemon')
subdir('tools') subdir('tools')
subdir('modules') subdir('modules')
if get_option('examples') if not get_option('examples').disabled()
subdir('examples') subdir('examples')
endif endif
if get_option('tests') if not get_option('tests').disabled()
subdir('tests') subdir('tests')
endif endif
if get_option('gstreamer') subdir('gst')
subdir('gst')
endif

View file

@ -69,7 +69,7 @@ pipewire_module_link_factory = shared_library('pipewire-module-link-factory',
pipewire_module_protocol_deps = [mathlib, dl_lib, pipewire_dep] pipewire_module_protocol_deps = [mathlib, dl_lib, pipewire_dep]
if get_option('systemd') if systemd_dep.found()
pipewire_module_protocol_deps += systemd_dep pipewire_module_protocol_deps += systemd_dep
endif endif

View file

@ -54,7 +54,7 @@ if ncurses_dep.found()
) )
endif endif
if get_option('pw-cat') and sndfile_dep.found() if not get_option('pw-cat').disabled() and sndfile_dep.found()
pwcat_sources = [ pwcat_sources = [
'pw-cat.c', 'pw-cat.c',
@ -80,5 +80,6 @@ if get_option('pw-cat') and sndfile_dep.found()
cmd = 'ln -fs @0@ $DESTDIR@1@'.format('pw-cat', dst) cmd = 'ln -fs @0@ $DESTDIR@1@'.format('pw-cat', dst)
meson.add_install_script('sh', '-c', cmd) meson.add_install_script('sh', '-c', cmd)
endforeach endforeach
elif not sndfile_dep.found() and get_option('pw-cat').enabled()
error('pw-cat is enabled but required dependency `sndfile` was not found.')
endif endif