Skip to content

Commit 9ccf75f

Browse files
committed
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
1 parent 11e134b commit 9ccf75f

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

meson.build

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,7 @@ can_add_dist_script = not meson.is_subproject() or meson.version().version_compa
259259
subdir('MSVC_NMake')
260260
subdir('sigc++')
261261
subdir('examples')
262-
if build_tests
263-
subdir('tests')
264-
endif
262+
subdir('tests')
265263
subdir('docs/reference')
266264
subdir('docs/manual')
267265

tests/meson.build

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# tests
22

3-
# input: sigcxx_own_dep, do_benchmark, can_benchmark, benchmark_dep
3+
# input: sigcxx_own_dep, build_tests, do_benchmark, can_benchmark, benchmark_dep
44

55
benchmark_timeout = 100
66

@@ -59,10 +59,13 @@ foreach ex : test_programs
5959
exe_file = executable(ex_name, ex_sources,
6060
dependencies: sigcxx_own_dep,
6161
implicit_include_directories: false,
62-
build_by_default: true
62+
build_by_default: build_tests,
6363
)
6464

65-
test(ex_name, exe_file)
65+
# If exe_file is a test program, it is built by default unconditionally.
66+
if build_tests
67+
test(ex_name, exe_file)
68+
endif
6669
endforeach
6770

6871
if can_benchmark

0 commit comments

Comments
 (0)