From 6cd849125888782ed12af87f80a1ee9c43bcf553 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 4 May 2024 16:47:55 +0300 Subject: test: Don't add current build directory to include path Meson adds the current source and build directory to the include path by default. This causes a namespace clash in tests when using C++20, as the Span class test is compiled into a binary named 'span', which then gets included by source code through indirect '#include ' directives. Unsurprisingly, the compiler doesn't react happily when fed binary data. We could work around the problem by renaming the test executable, but disabling the implicit inclusion of the local directory is a more generic solution that will avoid similar issues in the future. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- test/meson.build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/meson.build b/test/meson.build index 8b6057d4..5ed052ed 100644 --- a/test/meson.build +++ b/test/meson.build @@ -89,6 +89,7 @@ foreach test : public_tests exe = executable(test['name'], test['sources'], dependencies : deps, + implicit_include_directories : false, link_with : test_libraries, include_directories : test_includes_public) @@ -103,6 +104,7 @@ foreach test : internal_tests exe = executable(test['name'], test['sources'], dependencies : deps, + implicit_include_directories : false, link_with : test_libraries, include_directories : test_includes_internal) @@ -117,6 +119,7 @@ foreach test : internal_non_parallel_tests exe = executable(test['name'], test['sources'], dependencies : deps, + implicit_include_directories : false, link_with : test_libraries, include_directories : test_includes_internal) -- cgit v1.2.1