From 517757791e1245ae9f7aa72d496b7f16c31d84f9 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 1 Sep 2018 11:21:15 +0530 Subject: [PATCH] meson: Use feature option for tests option This was somehow missed the last time around. --- meson.build | 7 ++++++- meson_options.txt | 2 +- tests/check/meson.build | 4 ---- tests/meson.build | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index 2d79283838..77be55f908 100644 --- a/meson.build +++ b/meson.build @@ -116,6 +116,11 @@ gstapp_dep = dependency('gstreamer-app-1.0', version : gst_req, fallback : ['gst-plugins-base', 'app_dep']) gstnet_dep = dependency('gstreamer-net-1.0', version : gst_req, fallback : ['gstreamer', 'gst_net_dep']) +if host_machine.system() != 'windows' + gstcheck_dep = dependency('gstreamer-check-1.0', version : gst_req, + required : get_option('tests'), + fallback : ['gstreamer', 'gst_check_dep']) +endif gir = find_program('g-ir-scanner', required : get_option('introspection')) gnome = import('gnome') @@ -134,7 +139,7 @@ if get_option('default_library') == 'shared' endif subdir('gst') -if get_option('tests') +if not get_option('tests').disabled() subdir('tests') endif if not get_option('examples').disabled() diff --git a/meson_options.txt b/meson_options.txt index eb6f20f24f..40d676fe40 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -5,7 +5,7 @@ option('package-name', type : 'string', yield : true, option('package-origin', type : 'string', value : 'Unknown package origin', yield : true, description : 'package origin URL to use in plugins') -option('tests', type : 'boolean', value : true, +option('tests', type : 'feature', value : 'auto', yield : true, description : 'Build and enable unit tests') option('examples', type : 'feature', value : 'auto', yield : true, description : 'Build the examples') diff --git a/tests/check/meson.build b/tests/check/meson.build index 71db67f99e..fb9eb9be0a 100644 --- a/tests/check/meson.build +++ b/tests/check/meson.build @@ -1,8 +1,4 @@ # FIXME: something is wrong with plugin paths / whitelisting here -gstcheck_dep = dependency('gstreamer-check-1.0', version : gst_req, - fallback : ['gstreamer', 'gst_check_dep']) - - pluginsdirs = [] if gst_dep.type_name() == 'pkgconfig' pbase = dependency('gstreamer-plugins-base-' + api_version, required : false) diff --git a/tests/meson.build b/tests/meson.build index f87683d9ef..5374bcba45 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,4 +1,5 @@ -if host_machine.system() != 'windows' +# FIXME: make check work on windows +if host_machine.system() != 'windows' and gstcheck_dep.found() subdir('check') endif