Skip to content

Commit 5711e2b

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 dc2f2f4 commit 5711e2b

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
@@ -256,9 +256,7 @@ can_add_dist_script = not meson.is_subproject() or meson.version().version_compa
256256
subdir('MSVC_NMake')
257257
subdir('sigc++')
258258
subdir('examples')
259-
if build_tests
260-
subdir('tests')
261-
endif
259+
subdir('tests')
262260
subdir('docs/docs/reference')
263261
subdir('docs/docs/manual')
264262

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

@@ -67,10 +67,13 @@ foreach ex : test_programs
6767
exe_file = executable(ex_name, ex_sources,
6868
dependencies: sigcxx_own_dep,
6969
implicit_include_directories: false,
70-
build_by_default: true
70+
build_by_default: build_tests,
7171
)
7272

73-
test(ex_name, exe_file)
73+
# If exe_file is a test program, it is built by default unconditionally.
74+
if build_tests
75+
test(ex_name, exe_file)
76+
endif
7477
endforeach
7578

7679
if can_benchmark

0 commit comments

Comments
 (0)