summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2022-11-07 13:20:13 +0100
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2022-11-07 13:20:13 +0100
commit5711e2bc736d9a06fd19b838732568911baab6f1 (patch)
treebb7ffe1bff95ccca3393b0828fe56f77c1870ff7
parentdc2f2f4e6daea26a8901cf86ebb0d4cd0b3b726e (diff)
downloadsigc++-5711e2bc736d9a06fd19b838732568911baab6f1.tar.gz
Meson build: Always call subdir('tests')
Make the build_tests check more like the check in cairomm and libxml++. Then it's possible to combine build-tests=false with benchmark=true. See PR#84
-rw-r--r--meson.build4
-rw-r--r--tests/meson.build9
2 files changed, 7 insertions, 6 deletions
diff --git a/meson.build b/meson.build
index 70be03b..629e86e 100644
--- a/meson.build
+++ b/meson.build
@@ -256,9 +256,7 @@ can_add_dist_script = not meson.is_subproject() or meson.version().version_compa
subdir('MSVC_NMake')
subdir('sigc++')
subdir('examples')
-if build_tests
- subdir('tests')
-endif
+subdir('tests')
subdir('docs/docs/reference')
subdir('docs/docs/manual')
diff --git a/tests/meson.build b/tests/meson.build
index 87605a4..e0f57d7 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,6 +1,6 @@
# tests
-# input: sigcxx_own_dep, do_benchmark, can_benchmark, benchmark_dep
+# input: sigcxx_own_dep, build_tests, do_benchmark, can_benchmark, benchmark_dep
benchmark_timeout = 100
@@ -67,10 +67,13 @@ foreach ex : test_programs
exe_file = executable(ex_name, ex_sources,
dependencies: sigcxx_own_dep,
implicit_include_directories: false,
- build_by_default: true
+ build_by_default: build_tests,
)
- test(ex_name, exe_file)
+ # If exe_file is a test program, it is built by default unconditionally.
+ if build_tests
+ test(ex_name, exe_file)
+ endif
endforeach
if can_benchmark