From 1aed35da7d391ff72ad4201891e670f97e28cd39 Mon Sep 17 00:00:00 2001 From: Matthias Klumpp Date: Sun, 22 Feb 2026 16:01:42 +0100 Subject: [PATCH] meson: Fix tests when building with Meson (#326) --- meson.build | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 18f966f..f028434 100644 --- a/meson.build +++ b/meson.build @@ -49,17 +49,21 @@ run_command( if get_option('build_tests') + test_flags = ['-D__TEST_DIR__=' + meson.project_source_root() / 'test'] + inja_test = executable( 'inja_test', 'test/test.cpp', - dependencies: inja_dep + dependencies: inja_dep, + cpp_args: test_flags, ) inja_single_test = executable( 'inja_single_test', 'test/test.cpp', 'single_include/inja/inja.hpp', - dependencies: [inja_dep] + dependencies: [inja_dep], + cpp_args: test_flags, ) test('Inja unit test', inja_test) @@ -69,6 +73,7 @@ if get_option('build_tests') inja_benchmark = executable( 'inja_benchmark', 'test/benchmark.cpp', - dependencies: inja_dep + dependencies: inja_dep, + cpp_args: test_flags, ) endif