From 55fe0ffb8c6941733494f97c17c817f93050b973 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 3 Oct 2018 09:28:53 +0100 Subject: [PATCH] meson: add options to disable benchmarks, examples, tools Like we have in other modules. --- examples/meson.build | 4 ++++ meson.build | 13 +++++++++++-- meson_options.txt | 5 +++++ testsuite/meson.build | 5 ++++- 4 files changed, 24 insertions(+), 3 deletions(-) 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 -- 2.7.4