From 5711e2bc736d9a06fd19b838732568911baab6f1 Mon Sep 17 00:00:00 2001 From: Kjell Ahlstedt Date: Mon, 7 Nov 2022 13:20:13 +0100 Subject: 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 --- meson.build | 4 +--- tests/meson.build | 9 ++++++--- 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 -- cgit v1.2.1