meson: add option to disable orc-test library
authorTim-Philipp Müller <tim@centricular.com>
Sat, 6 Oct 2018 12:04:01 +0000 (13:04 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 6 Oct 2018 12:04:01 +0000 (13:04 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=736785

examples/meson.build
meson.build
meson_options.txt

index 2a0e303..7d75128 100644 (file)
@@ -1,6 +1,6 @@
 if not meson.is_cross_build()
 
-  if not have_tools
+  if opt_tools.disabled() and opt_examples.enabled()
     error('Need to build tools (orcc) to build examples.')
   endif
 
index 25d048a..5763f1d 100644 (file)
@@ -125,20 +125,32 @@ cdata.set_quoted('PACKAGE_VERSION', meson.project_version())
 cdata.set_quoted('VERSION', meson.project_version())
 
 subdir('orc')
-subdir('orc-test')
 
-have_tools = not get_option('tools').disabled()
-if have_tools
+opt_examples = get_option('examples')
+opt_orctest = get_option('orc-test')
+opt_tests = get_option('tests')
+opt_tools = get_option('tools')
+
+if not opt_orctest.disabled()
+  subdir('orc-test')
+else
+  if opt_tests.enabled()
+    error('Tests were enabled explicitly, but the orc-test library was disabled.')
+  endif
+  orc_test_dep = disabler() # for testsuites + orc-bugreport
+endif
+
+if not opt_tools.disabled()
   subdir('tools')
 else
   orcc = disabler() # for testsuite/orcc/
 endif
 
-if not get_option('examples').disabled()
+if not opt_examples.disabled()
   subdir('examples')
 endif
 
-if not get_option('tests').disabled()
+if not opt_tests.disabled()
   subdir('testsuite')
 endif
 
index 278e177..3c43d7a 100644 (file)
@@ -1,5 +1,8 @@
 option('orc-backend', type : 'combo', choices : ['sse', 'mmx', 'neon', 'mips', 'altivec', 'c64x', 'all'], value : 'all')
 
+# Orc feature options
+option('orc-test', type : 'feature', value : 'auto', description : 'Build the orc-test library used for unit testing and by the orc-bugreport tool')
+
 # Common feature options
 option('benchmarks', type : 'feature', value : 'auto', yield : true)
 option('examples', type : 'feature', value : 'auto', yield : true)