Skip to content

Commit 1aed35d

Browse files
authored
meson: Fix tests when building with Meson (#326)
1 parent 88e1113 commit 1aed35d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

meson.build

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,21 @@ run_command(
4949

5050

5151
if get_option('build_tests')
52+
test_flags = ['-D__TEST_DIR__=' + meson.project_source_root() / 'test']
53+
5254
inja_test = executable(
5355
'inja_test',
5456
'test/test.cpp',
55-
dependencies: inja_dep
57+
dependencies: inja_dep,
58+
cpp_args: test_flags,
5659
)
5760

5861
inja_single_test = executable(
5962
'inja_single_test',
6063
'test/test.cpp',
6164
'single_include/inja/inja.hpp',
62-
dependencies: [inja_dep]
65+
dependencies: [inja_dep],
66+
cpp_args: test_flags,
6367
)
6468

6569
test('Inja unit test', inja_test)
@@ -69,6 +73,7 @@ if get_option('build_tests')
6973
inja_benchmark = executable(
7074
'inja_benchmark',
7175
'test/benchmark.cpp',
72-
dependencies: inja_dep
76+
dependencies: inja_dep,
77+
cpp_args: test_flags,
7378
)
7479
endif

0 commit comments

Comments
 (0)