From 6811acb1d2e0354613a97e792b2d6cc19c808a47 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 2 Sep 2022 14:26:18 +0200 Subject: [PATCH] Do not mangle recorded paths when building for coverage. ... and see if it helps for coverage reports (cobertura, sonar, ...) --- tools/cmake/Flags.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cmake/Flags.cmake b/tools/cmake/Flags.cmake index 9c4e60b7a1..ba2e37fe70 100644 --- a/tools/cmake/Flags.cmake +++ b/tools/cmake/Flags.cmake @@ -101,7 +101,7 @@ if(enable_compile_optimizations AND CMAKE_COMPILER_IS_GNUCC endif() # Do not leak the current directory into the binaries -if(CMAKE_COMPILER_IS_GNUCC) +if(CMAKE_COMPILER_IS_GNUCC AND NOT enable_coverage) execute_process(COMMAND realpath --relative-to=${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} RESULT_VARIABLE RESULT OUTPUT_VARIABLE RELATIVE_SOURCE_DIR ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) if(RESULT EQUAL 0) -- 2.20.1