From: Tim-Philipp Müller Date: Wed, 3 Oct 2018 08:28:53 +0000 (+0100) Subject: meson: add options to disable benchmarks, examples, tools X-Git-Tag: orc-0.4.33~158 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=55fe0ffb8c6941733494f97c17c817f93050b973;p=platform%2Fupstream%2Forc.git meson: add options to disable benchmarks, examples, tools Like we have in other modules. --- diff --git a/examples/meson.build b/examples/meson.build index 6e76660..2a0e303 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -1,5 +1,9 @@ if not meson.is_cross_build() + if not have_tools + error('Need to build tools (orcc) to build examples.') + endif + examples = ['example1', 'example2', 'example3', 'mt19937ar'] foreach ex : examples diff --git a/meson.build b/meson.build index e192218..7343175 100644 --- a/meson.build +++ b/meson.build @@ -126,8 +126,17 @@ cdata.set_quoted('VERSION', meson.project_version()) subdir('orc') subdir('orc-test') -subdir('tools') -subdir('examples') + +have_tools = not get_option('tools').disabled() +if have_tools + subdir('tools') +else + orcc = disabler() # for testsuite/orcc/ +endif + +if not get_option('examples').disabled() + subdir('examples') +endif if not get_option('tests').disabled() subdir('testsuite') diff --git a/meson_options.txt b/meson_options.txt index ad74d85..2e99f33 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,8 @@ option('enable-backend', type : 'combo', choices : ['sse', 'mmx', 'neon', 'mips', 'altivec', 'c64x', 'all'], value : 'all') + +# Common feature options +option('benchmarks', type : 'feature', value : 'auto', yield : true) +option('examples', type : 'feature', value : 'auto', yield : true) option('gtk_doc', type : 'feature', value : 'auto', yield : true, description : 'Generate API documentation with gtk-doc') option('tests', type : 'feature', value : 'auto', yield : true) +option('tools', type : 'feature', value : 'auto', yield : true) diff --git a/testsuite/meson.build b/testsuite/meson.build index 668609e..dd4c20e 100644 --- a/testsuite/meson.build +++ b/testsuite/meson.build @@ -40,4 +40,7 @@ foreach bin : noinst_bins endforeach subdir('orcc') -subdir('benchmorc') + +if not get_option('benchmarks').disabled() + subdir('benchmorc') +endif