From: Arnaud Giersch Date: Fri, 2 Sep 2022 12:26:18 +0000 (+0200) Subject: Do not mangle recorded paths when building for coverage. X-Git-Tag: v3.32~37 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6811acb1d2e0354613a97e792b2d6cc19c808a47 Do not mangle recorded paths when building for coverage. ... and see if it helps for coverage reports (cobertura, sonar, ...) --- 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)