summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2018-07-27 18:59:23 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2018-07-27 19:04:38 +0530
commitb55dfb5313f1df702a3637efbd372b90cd12a300 (patch)
treeae7f255314e783be74b9201cd6dfcd8ca9da18b5 /sys
parent7ef303fa281b9226ebd0087fb377ca25887941e4 (diff)
downloadgstreamer-plugins-bad-b55dfb5313f1df702a3637efbd372b90cd12a300.tar.gz
Add feature options for almost all plugins
The only plugins remaining are those that haven't been ported to Meson yet, and msdk. Also, the tests are still automagic. https://bugzilla.gnome.org/show_bug.cgi?id=795107
Diffstat (limited to 'sys')
-rw-r--r--sys/bluez/meson.build21
-rw-r--r--sys/d3dvideosink/meson.build15
-rw-r--r--sys/decklink/meson.build10
-rw-r--r--sys/directsound/meson.build16
-rw-r--r--sys/dvb/meson.build26
-rw-r--r--sys/fbdev/meson.build11
-rw-r--r--sys/ipcpipeline/meson.build20
-rw-r--r--sys/kms/meson.build3
-rw-r--r--sys/msdk/meson.build1
-rw-r--r--sys/shm/meson.build32
-rw-r--r--sys/uvch264/meson.build7
-rw-r--r--sys/wasapi/meson.build20
-rw-r--r--sys/winks/meson.build9
-rw-r--r--sys/winscreencap/meson.build15
14 files changed, 145 insertions, 61 deletions
diff --git a/sys/bluez/meson.build b/sys/bluez/meson.build
index 373feaea2..19386f3b2 100644
--- a/sys/bluez/meson.build
+++ b/sys/bluez/meson.build
@@ -7,21 +7,16 @@ bluez_sources = [
'gstavrcputil.c',
]
-bluez_dep = dependency('bluez', version : '>= 5.0', required : false)
-gio_unix_dep = dependency('gio-unix-2.0', version : glib_req, required : false)
+bluez_dep = dependency('bluez', version : '>= 5.0', required : get_option('bluez'))
+gio_unix_dep = dependency('gio-unix-2.0', version : glib_req,
+ fallback: ['glib', 'libgiounix_dep'],
+ required : get_option('bluez'))
if bluez_dep.found() and gio_unix_dep.found()
- # FIXME: do we really need the meson.current_build_dir() here? Shouldn't
- # the custom command be executed with the current build directoy as working
- # directory? Without this, bluez.[ch] are created in the top-level build dir!
- bluez_ch = custom_target('bluez_ch',
- output : [ 'bluez.h', 'bluez.c' ] ,
- input : 'org.bluez.xml',
- command : [ find_program('gdbus-codegen'),
- '--c-namespace=Bluez',
- '--generate-c-code=' + meson.current_build_dir() + '/bluez',
- '--interface-prefix=org.bluez',
- '@INPUT@' ])
+ bluez_ch = gnome.gdbus_codegen('bluez-interface',
+ sources : 'org.bluez.xml',
+ interface_prefix : 'org.bluez',
+ namespace : 'Bluez')
gstbluez = library('gstbluez',
bluez_sources, bluez_ch,
diff --git a/sys/d3dvideosink/meson.build b/sys/d3dvideosink/meson.build
index 26c34b7c2..c9230dabd 100644
--- a/sys/d3dvideosink/meson.build
+++ b/sys/d3dvideosink/meson.build
@@ -3,14 +3,23 @@ d3dvideosink_sources = [
'd3dvideosink.c',
]
-if host_system == 'windows' and cc.has_header('d3d9.h')
- d3dvideosink_dep = [cc.find_library('d3d9'), cc.find_library('gdi32')]
+if host_system != 'windows' or get_option('d3dvideosink').disabled()
+ subdir_done()
+endif
+
+d3d_dep = cc.find_library('d3d9', required : get_option('d3dvideosink'))
+gdi_dep = cc.find_library('gdi32', required : get_option('d3dvideosink'))
+have_d3d9_h = cc.has_header('d3d9.h')
+if not have_d3d9_h and get_option('d3dvideosink').enabled()
+ error('d3dvideosink plugin enabled but d3d9.h not found')
+endif
+if d3d_dep.found() and gdi_dep.found() and have_d3d9_h
gstd3dvideosink = library('gstd3d',
d3dvideosink_sources,
c_args : gst_plugins_bad_args,
include_directories : [configinc],
- dependencies : [gstvideo_dep] + d3dvideosink_dep,
+ dependencies : [gstvideo_dep, d3d_dep, gdi_dep],
install : true,
install_dir : plugins_install_dir)
pkgconfig.generate(gstd3dvideosink, install_dir : plugins_pkgconfig_install_dir)
diff --git a/sys/decklink/meson.build b/sys/decklink/meson.build
index 3cb4bdaeb..78644374f 100644
--- a/sys/decklink/meson.build
+++ b/sys/decklink/meson.build
@@ -6,15 +6,19 @@ decklink_sources = [
'gstdecklinkvideosrc.cpp',
]
+if get_option('decklink').disabled()
+ subdir_done()
+endif
+
build_decklink = false
decklink_ldflags = []
decklink_libs = []
-if host_machine.system() == 'windows'
+if host_system == 'windows'
decklink_sources += ['win/DeckLinkAPIDispatch.cpp', 'win/DeckLinkAPI_i.c']
if cxx.get_id() == 'msvc'
# FIXME: Use commsuppwd.lib for debug builds?
- comutil_dep = cxx.find_library('comsuppw')
+ comutil_dep = cxx.find_library('comsuppw', required : get_option('decklink'))
if comutil_dep.found()
build_decklink = true
decklink_libs = [comutil_dep]
@@ -23,7 +27,7 @@ if host_machine.system() == 'windows'
build_decklink = true
endif
else
- libdl = cc.find_library('dl', required: false)
+ libdl = cc.find_library('dl', required: get_option('decklink'))
have_pthread_h = cdata.has('HAVE_PTHREAD_H')
if libdl.found() and have_pthread_h
decklink_libs = [libm, libdl, dependency('threads')]
diff --git a/sys/directsound/meson.build b/sys/directsound/meson.build
index 03ec447a4..9e7f1325e 100644
--- a/sys/directsound/meson.build
+++ b/sys/directsound/meson.build
@@ -12,14 +12,24 @@ directsoundsrc_device_flags = [
'-DGST_DIRECTSOUND_SRC_DEVICE_PROVIDER=1'
]
-if host_system == 'windows' and cc.has_header('dsound.h')
- directsoundsrc_dep = [cc.find_library('dsound'), cc.find_library('winmm'), cc.find_library('ole32')]
+if host_system != 'windows' or get_option('directsound').disabled()
+ subdir_done()
+endif
+
+dsound_dep = cc.find_library('dsound', required : get_option('directsound'))
+winmm_dep = cc.find_library('winmm', required : get_option('directsound'))
+ole32_dep = cc.find_library('ole32', required : get_option('directsound'))
+have_dsound_h = cc.has_header('dsound.h')
+if not have_dsound_h and get_option('directsound').enabled()
+ error('directsound plugin enabled but dsound.h not found')
+endif
+if dsound_dep.found() and winmm_dep.found() and ole32_dep.found() and have_dsound_h
gstdirectsoundsrc = library('gstdirectsoundsrc',
directsoundsrc_sources,
c_args : gst_plugins_bad_args + directsoundsrc_device_flags,
include_directories : [configinc],
- dependencies : [gstaudio_dep] + directsoundsrc_dep,
+ dependencies : [gstaudio_dep, dsound_dep, winmm_dep, ole32_dep],
install : true,
install_dir : plugins_install_dir)
pkgconfig.generate(gstdirectsoundsrc, install_dir : plugins_pkgconfig_install_dir)
diff --git a/sys/dvb/meson.build b/sys/dvb/meson.build
index 5d3e7d1f5..d8b496b2a 100644
--- a/sys/dvb/meson.build
+++ b/sys/dvb/meson.build
@@ -15,18 +15,22 @@ dvb_sources = [
'parsechannels.c',
]
-dvb_check_code_lines = [
- '#include <linux/dvb/version.h>\n\n',
- '#if DVB_API_VERSION < 5 || (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR <= 4)\n\n',
- '#error "Incompatible dvb API"\n\n',
- '#endif',
-]
-dvb_check_code=''
-foreach l : dvb_check_code_lines
- dvb_check_code = dvb_check_code + l
-endforeach
+if get_option('dvb').disabled()
+ subdir_done()
+endif
+
+dvb_check_code = '''
+#include <linux/dvb/version.h>
+#if DVB_API_VERSION < 5 || (DVB_API_VERSION == 5 && DVB_API_VERSION_MINOR <= 4)
+#error "Incompatible dvb API"
+#endif'
+'''
+have_dvb = cc.compiles(dvb_check_code)
+if not have_dvb and get_option('dvb').enabled()
+ error('DVB plugin enabled but dvb headers not found')
+endif
-if cc.compiles(dvb_check_code)
+if have_dvb
gstdvb = library('gstdvb',
dvb_sources,
c_args : gst_plugins_bad_args + [ '-DGST_USE_UNSTABLE_API' ],
diff --git a/sys/fbdev/meson.build b/sys/fbdev/meson.build
index 1aed2ad38..84ee057f0 100644
--- a/sys/fbdev/meson.build
+++ b/sys/fbdev/meson.build
@@ -2,7 +2,16 @@ fbdevsink_sources = [
'gstfbdevsink.c',
]
-if cc.has_header('linux/fb.h')
+if get_option('fbdev').disabled()
+ subdir_done()
+endif
+
+have_fb_h = cc.has_header('linux/fb.h')
+if not have_fb_h and get_option('fbdev').enabled()
+ error('fbdev plugin enabled but fb.h not found')
+endif
+
+if have_fb_h
gstfbdevsink = library('gstfbdevsink',
fbdevsink_sources,
c_args : gst_plugins_bad_args,
diff --git a/sys/ipcpipeline/meson.build b/sys/ipcpipeline/meson.build
index 3ebf58ed2..1ea4c69f4 100644
--- a/sys/ipcpipeline/meson.build
+++ b/sys/ipcpipeline/meson.build
@@ -6,8 +6,25 @@ ipcpipeline_sources = [
'gstipcslavepipeline.c'
]
-if cc.has_header ('sys/socket.h') and cc.has_function ('pipe') and cc.has_function ('socketpair')
+if get_option('ipcpipeline').disabled()
+ subdir_done()
+endif
+have_socket_h = cc.has_header('sys/socket.h')
+if not have_socket_h and get_option('ipcpipeline').enabled()
+ error('ipcpipeline plugin enabled but socket.h not found')
+endif
+have_pipe = cc.has_function('pipe')
+if not have_pipe and get_option('ipcpipeline').enabled()
+ error('ipcpipeline plugin enabled but pipe() not found')
+endif
+have_socketpair = cc.has_function('socketpair')
+if not have_socketpair and get_option('ipcpipeline').enabled()
+ error('ipcpipeline plugin enabled but socketpair() not found')
+endif
+
+
+if have_socket_h and have_pipe and have_socketpair
gstipcpipeline = library('gstipcpipeline',
ipcpipeline_sources,
c_args : gst_plugins_bad_args,
@@ -17,5 +34,4 @@ if cc.has_header ('sys/socket.h') and cc.has_function ('pipe') and cc.has_functi
install_dir : plugins_install_dir,
)
pkgconfig.generate(gstipcpipeline, install_dir : plugins_pkgconfig_install_dir)
-
endif
diff --git a/sys/kms/meson.build b/sys/kms/meson.build
index 4a3f5435f..fbc18617e 100644
--- a/sys/kms/meson.build
+++ b/sys/kms/meson.build
@@ -5,8 +5,7 @@ kmssink_sources = [
'gstkmsutils.c',
]
-libdrm_dep = dependency('libdrm', version : '>= 2.4.55', required : false)
-
+libdrm_dep = dependency('libdrm', version : '>= 2.4.55', required : get_option('kms'))
if libdrm_dep.found()
gstkmssink = library('gstkms',
kmssink_sources,
diff --git a/sys/msdk/meson.build b/sys/msdk/meson.build
index 049d17fc1..a08d8ca61 100644
--- a/sys/msdk/meson.build
+++ b/sys/msdk/meson.build
@@ -30,6 +30,7 @@ else
msdk_sources += ['msdk_libva.c', 'gstmsdkallocator_libva.c']
endif
+# FIXME: automagic
msdk_root = run_command(python3, '-c', 'import os; print(os.environ.get("INTELMEDIASDKROOT", os.environ.get("MFX_HOME", "")))').stdout().strip()
have_msdk = false
diff --git a/sys/shm/meson.build b/sys/shm/meson.build
index 7ae72f353..6f573cfbf 100644
--- a/sys/shm/meson.build
+++ b/sys/shm/meson.build
@@ -6,25 +6,35 @@ shm_sources = [
'gstshmsink.c',
]
-shm_enabled = false
+if get_option('shm').disabled()
+ subdir_done()
+endif
+
shm_deps = []
-rt_dep = cc.find_library ('rt', required: false)
+if ['osx', 'bsd'].contains(host_system)
+ rt_dep = []
+ shm_enabled = true
+else
+ rt_dep = cc.find_library ('rt', required: false)
+ shm_enabled = rt_dep.found()
+endif
-if cc.has_header ('sys/socket.h') and (host_system == 'osx' or
- host_system == 'bsd' or rt_dep.found())
+if shm_enabled
+ shm_enabled = cc.has_header('sys/socket.h')
+elif get_option('shm').enabled()
+ error('shm plugin enabled but librt not found')
+endif
- shm_enabled = true
- shm_deps = [gstbase_dep]
+if not shm_enabled and get_option('shm').enabled()
+ error('shm plugin enabled but socket.h not found')
+endif
- if rt_dep.found()
- shm_deps += [rt_dep]
- endif
-
+if shm_enabled
gstshm = library('gstshm',
shm_sources,
c_args : gst_plugins_bad_args + ['-DSHM_PIPE_USE_GLIB'],
include_directories : [configinc],
- dependencies : shm_deps,
+ dependencies : [gstbase_dep, rt_dep],
install : true,
install_dir : plugins_install_dir,
)
diff --git a/sys/uvch264/meson.build b/sys/uvch264/meson.build
index c4f100179..f2cc31386 100644
--- a/sys/uvch264/meson.build
+++ b/sys/uvch264/meson.build
@@ -5,9 +5,12 @@ uvch264_sources = [
'uvc_h264.c',
]
-libgudev_dep = dependency('gudev-1.0', required : false)
-libusb_dep = dependency('libusb-1.0', required : false)
+libgudev_dep = dependency('gudev-1.0', required : get_option('uvch264'))
+libusb_dep = dependency('libusb-1.0', required : get_option('uvch264'))
has_uvcvideo_h = cc.has_header('linux/uvcvideo.h')
+if not has_uvcvideo_h and get_option('uvch264').enabled()
+ error('uvch264 plugin enabled but uvcvideo.h not found')
+endif
if libgudev_dep.found() and libusb_dep.found() and has_uvcvideo_h
gstuvch264 = library('gstuvch264',
diff --git a/sys/wasapi/meson.build b/sys/wasapi/meson.build
index c5b47dd03..cf57d8784 100644
--- a/sys/wasapi/meson.build
+++ b/sys/wasapi/meson.build
@@ -6,15 +6,27 @@ wasapi_sources = [
'gstwasapidevice.c',
]
-if host_system == 'windows' and cc.has_header('audioclient.h')
- wasapi_dep = [cc.find_library('ole32'), cc.find_library('ksuser'),
- cc.find_library('avrt', required : false)]
+if host_system != 'windows'
+ if get_option('wasapi').disabled()
+ subdir_done()
+ elif get_option('wasapi').enabled()
+ error('Cannot build wasapi plugin when not building for Windows')
+ endif
+endif
+
+ole32_dep = cc.find_library('ole32', required : get_option('wasapi'))
+ksuser_dep = cc.find_library('ksuser', required : get_option('wasapi'))
+have_audioclient_h = cc.has_header('audioclient.h')
+if not have_audioclient_h and get_option('wasapi').enabled()
+ error('wasapi plugin enabled but audioclient.h not found')
+endif
+if ole32_dep.found() and ksuser_dep.found() and have_audioclient_h
gstwasapi = library('gstwasapi',
wasapi_sources,
c_args : gst_plugins_bad_args + ['-DCOBJMACROS'],
include_directories : [configinc],
- dependencies : [gstaudio_dep] + wasapi_dep,
+ dependencies : [gstaudio_dep, ole32_dep, ksuser_dep],
install : true,
install_dir : plugins_install_dir)
pkgconfig.generate(gstwasapi, install_dir : plugins_pkgconfig_install_dir)
diff --git a/sys/winks/meson.build b/sys/winks/meson.build
index 59036a184..eea1a31a9 100644
--- a/sys/winks/meson.build
+++ b/sys/winks/meson.build
@@ -8,9 +8,12 @@ winks_sources = [
]
if host_system == 'windows'
- winks_dep = [cc.find_library('ksuser'), cc.find_library('uuid'),
- cc.find_library('strmiids'), cc.find_library('dxguid'),
- cc.find_library('setupapi'), cc.find_library('ole32')]
+ winks_dep = [cc.find_library('ksuser', required : get_option('winks')),
+ cc.find_library('uuid', required : get_option('winks')),
+ cc.find_library('strmiids', required : get_option('winks')),
+ cc.find_library('dxguid', required : get_option('winks')),
+ cc.find_library('setupapi', required : get_option('winks')),
+ cc.find_library('ole32', required : get_option('winks'))]
gstwinks = library('gstwinks',
winks_sources,
diff --git a/sys/winscreencap/meson.build b/sys/winscreencap/meson.build
index ad1a2e200..6f3511c58 100644
--- a/sys/winscreencap/meson.build
+++ b/sys/winscreencap/meson.build
@@ -4,14 +4,23 @@ winscreencap_sources = [
'gstwinscreencap.c',
]
-if host_system == 'windows' and cc.has_header('d3d9.h')
- winscreencap_dep = [cc.find_library('d3d9'), cc.find_library('gdi32')]
+if host_system != 'windows' or get_option('winscreencap').disabled()
+ subdir_done()
+endif
+
+d3d_dep = cc.find_library('d3d9', required : get_option('winscreencap'))
+gdi_dep = cc.find_library('gdi32', required : get_option('winscreencap'))
+have_d3d9_h = cc.has_header('d3d9.h')
+if not have_d3d9_h and get_option('winscreencap').enabled()
+ error('winscreencap plugin enabled but d3d9.h not found')
+endif
+if d3d_dep.found() and gdi_dep.found() and have_d3d9_h
gstwinscreencap = library('gstwinscreencap',
winscreencap_sources,
c_args : gst_plugins_bad_args,
include_directories : [configinc],
- dependencies : [gstbase_dep, gstvideo_dep] + winscreencap_dep,
+ dependencies : [gstbase_dep, gstvideo_dep, d3d_dep, gdi_dep],
install : true,
install_dir : plugins_install_dir,
)