Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Do not mangle recorded paths when building for coverage.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 2 Sep 2022 12:26:18 +0000 (14:26 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 2 Sep 2022 12:27:13 +0000 (14:27 +0200)
... and see if it helps for coverage reports (cobertura, sonar, ...)

tools/cmake/Flags.cmake

index 9c4e60b..ba2e37f 100644 (file)
@@ -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)