From efa220a61544df303328ec9b95cc950887a81c5a Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 1 Sep 2018 12:17:08 +0530 Subject: [PATCH] meson: Add a feature option for tests This autodetection is needed on iOS inside Cerbero where gstreamer-check-1.0 is not available. --- meson.build | 3 ++- meson_options.txt | 2 ++ tests/meson.build | 5 ++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 3bd3bc9..2a9f274 100644 --- a/meson.build +++ b/meson.build @@ -77,7 +77,8 @@ gstbase_dep = dependency('gstreamer-base-1.0', version : gst_req, fallback : ['gstreamer', 'gst_base_dep']) if host_machine.system() != 'windows' gstcheck_dep = dependency('gstreamer-check-1.0', version : gst_req, - fallback : ['gstreamer', 'gst_check_dep'], required: false) + required : get_option('tests'), + fallback : ['gstreamer', 'gst_check_dep']) endif gstcontroller_dep = dependency('gstreamer-controller-1.0', version : gst_req, fallback : ['gstreamer', 'gst_controller_dep']) diff --git a/meson_options.txt b/meson_options.txt index 029c07b..6fc63ec 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -2,5 +2,7 @@ option('gtk_doc', type : 'feature', value : 'auto', yield : true, description : 'Build API documentation with gtk-doc') option('introspection', type : 'feature', value : 'auto', yield : true, description : 'Generate gobject-introspection bindings') +option('tests', type : 'feature', value : 'auto', yield : true, + description : 'Build and enable unit tests') option('pygi-overrides-dir', type : 'string', value : '', description: 'Path to pygobject overrides directory') diff --git a/tests/meson.build b/tests/meson.build index 547bba1..160a420 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,7 +1,6 @@ # FIXME: make check work on windows -if host_machine.system() != 'windows' -subdir('check') +if host_machine.system() != 'windows' and gstcheck_dep.found() + subdir('check') endif subdir('validate') - -- 2.7.4