summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2019-02-14 23:57:09 +0000
committerTim-Philipp Müller <tim@centricular.com>2019-02-14 23:57:09 +0000
commitb4b00545c7f3c149758539eedc8c5efabfcbc759 (patch)
tree023765d240fc76b3eb1bda15a1f2e90bd04d2399
parent9ff4dc533fb9c4023f35cf7baa2d26446b747391 (diff)
downloadgst-omx-b4b00545c7f3c149758539eedc8c5efabfcbc759.tar.gz
meson: add options to disable examples, tests and tools and bump meson requirement
-rw-r--r--meson.build23
-rw-r--r--meson_options.txt5
2 files changed, 21 insertions, 7 deletions
diff --git a/meson.build b/meson.build
index d482cee..4bb249f 100644
--- a/meson.build
+++ b/meson.build
@@ -1,6 +1,6 @@
project('gst-omx', 'c',
version : '1.15.1',
- meson_version : '>= 0.36.0',
+ meson_version : '>= 0.47',
default_options : [ 'warning_level=1',
'buildtype=debugoptimized' ])
@@ -151,10 +151,9 @@ gstgl_dep = dependency('gstreamer-gl-1.0', version : gst_req,
x11_dep = dependency('x11', required : false)
-if host_machine.system() != 'windows'
- gstcheck_dep = dependency('gstreamer-check-1.0', version : gst_req,
+gstcheck_dep = dependency('gstreamer-check-1.0', version : gst_req,
+ required : get_option('tests'),
fallback : ['gstreamer', 'gst_check_dep'])
-endif
libm = cc.find_library('m', required : false)
glib_dep = dependency('glib-2.0', version : glib_req)
@@ -325,10 +324,20 @@ cdata.set_quoted('GST_OMX_CONFIG_DIR', omx_conf_dir)
configure_file(output : 'config.h', configuration : cdata)
subdir('config')
-subdir('examples')
+
+if not get_option('examples').disabled()
+ subdir('examples')
+endif
+
subdir('omx')
-subdir('tools')
-subdir('tests')
+
+if not get_option('tools').disabled()
+ subdir('tools')
+endif
+
+if not get_option('tests').disabled() and gstcheck_dep.found()
+ subdir('tests')
+endif
python3 = find_program('python3')
run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
diff --git a/meson_options.txt b/meson_options.txt
index 609e71b..75985ce 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -6,3 +6,8 @@ option('target', type : 'combo',
option('struct_packing', type : 'combo',
choices : ['0', '1', '2', '4', '8'], value : '0',
description : 'Force OpenMAX struct packing')
+
+# Common feature options
+option('examples', type : 'feature', value : 'auto', yield : true)
+option('tests', type : 'feature', value : 'auto', yield : true)
+option('tools', type : 'feature', value : 'auto', yield : true)