From b4b00545c7f3c149758539eedc8c5efabfcbc759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 14 Feb 2019 23:57:09 +0000 Subject: [PATCH] meson: add options to disable examples, tests and tools and bump meson requirement --- meson.build | 23 ++++++++++++++++------- meson_options.txt | 5 +++++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index d482cee57f..4bb249fb57 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 609e71bfdf..75985ce614 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)