meson: Use feature for GStreamer and make it auto

Bumping version dependency of meson

Fix minor new warning in meson
This commit is contained in:
Thibault Saunier 2018-10-29 13:27:24 +00:00 committed by Wim Taymans
parent 8693e416bc
commit 795b352cba
4 changed files with 24 additions and 16 deletions

View file

@ -1,6 +1,6 @@
project('pipewire', 'c', project('pipewire', 'c',
version : '0.2.3', version : '0.2.3',
meson_version : '>= 0.42.0', meson_version : '>= 0.47.0',
default_options : [ 'warning_level=1', default_options : [ 'warning_level=1',
'c_std=gnu99', 'c_std=gnu99',
'buildtype=debugoptimized' ]) 'buildtype=debugoptimized' ])
@ -161,16 +161,25 @@ dl_lib = cc.find_library('dl', required : false)
pthread_lib = dependency('threads') pthread_lib = dependency('threads')
dbus_dep = dependency('dbus-1') dbus_dep = dependency('dbus-1')
if get_option('gstreamer') if not get_option('gstreamer').disabled()
glib_dep = dependency('glib-2.0', version : '>=2.32.0') build_gst = true
gobject_dep = dependency('gobject-2.0') glib_dep = [dependency('glib-2.0', version : '>=2.32.0', required: get_option('gstreamer'))]
gmodule_dep = dependency('gmodule-2.0') gobject_dep = [dependency('gobject-2.0', required: get_option('gstreamer'))]
gio_dep = [dependency('gio-2.0'), dependency('gio-unix-2.0')] gmodule_dep = [dependency('gmodule-2.0', required: get_option('gstreamer'))]
gst_dep = [dependency('gstreamer-1.0'), gio_dep = [dependency('gio-2.0', required: get_option('gstreamer')), dependency('gio-unix-2.0', required: get_option('gstreamer'))]
dependency('gstreamer-plugins-base-1.0'), gst_dep = [dependency('gstreamer-1.0', required: get_option('gstreamer')),
dependency('gstreamer-video-1.0'), dependency('gstreamer-plugins-base-1.0', required: get_option('gstreamer')),
dependency('gstreamer-audio-1.0'), dependency('gstreamer-video-1.0', required: get_option('gstreamer')),
dependency('gstreamer-allocators-1.0'),] dependency('gstreamer-audio-1.0', required: get_option('gstreamer')),
dependency('gstreamer-allocators-1.0', required: get_option('gstreamer')),]
foreach dep: glib_dep + gobject_dep + gio_dep + gst_dep
if build_gst and not dep.found()
build_gst = false
message('@0@ not found, disabling GStreamer'.format(dep))
endif
endforeach
else
build_gst = false
endif endif
subdir('spa') subdir('spa')

View file

@ -8,8 +8,8 @@ option('man',
value: false) value: false)
option('gstreamer', option('gstreamer',
description: 'Build GStreamer plugins', description: 'Build GStreamer plugins',
type: 'boolean', type: 'feature',
value: false) value: 'auto')
option('systemd', option('systemd',
description: 'Enable systemd integration', description: 'Enable systemd integration',
type: 'boolean', type: 'boolean',

View file

@ -13,12 +13,11 @@ pipewire_c_args = [
'-DG_LOG_DOMAIN=g_log_domain_pipewire', '-DG_LOG_DOMAIN=g_log_domain_pipewire',
] ]
conf_config = configuration_data()
conf_install_dir = join_paths(get_option('sysconfdir'), 'pipewire') conf_install_dir = join_paths(get_option('sysconfdir'), 'pipewire')
configure_file(input : 'pipewire.conf.in', configure_file(input : 'pipewire.conf.in',
output : 'pipewire.conf', output : 'pipewire.conf',
configuration : conf_config, copy : true,
install_dir : conf_install_dir) install_dir : conf_install_dir)

View file

@ -6,6 +6,6 @@ subdir('tools')
subdir('modules') subdir('modules')
subdir('examples') subdir('examples')
if get_option('gstreamer') if build_gst
subdir('gst') subdir('gst')
endif endif