Skip to content

Commit

Permalink
🔨 (cmake): unit tests - add gcc -fprofile-abs-path flag for better co…
Browse files Browse the repository at this point in the history
…verage
  • Loading branch information
ladislas committed Dec 6, 2022
1 parent b9d355c commit a6ce6c6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ if(COVERAGE)
# Append coverage compiler flags
set(COVERAGE_COMPILER_FLAGS "-g -O0 --coverage -fno-exceptions -fno-inline ")

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(COVERAGE_COMPILER_FLAGS "${COVERAGE_COMPILER_FLAGS} -fprofile-abs-path ")
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COVERAGE_COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_COMPILER_FLAGS}")
endif(COVERAGE)
Expand Down

0 comments on commit a6ce6c6

Please sign in to comment.