summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2022-11-07 13:50:41 +0100
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2022-11-07 13:50:41 +0100
commit9ccf75f30db6aa6a8fe74d9d0e6a36a9fee9538d (patch)
tree099dea80100bfa7508341a2c1c79a5b1572a275d
parent11e134b4aa0ce6729d8b27f45da9cacd063081fc (diff)
downloadsigc++-9ccf75f30db6aa6a8fe74d9d0e6a36a9fee9538d.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 0dd9d46..966d1c0 100644
--- a/meson.build
+++ b/meson.build
@@ -259,9 +259,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/reference')
subdir('docs/manual')
diff --git a/tests/meson.build b/tests/meson.build
index 7e9a2b3..c16aefe 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
@@ -59,10 +59,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