File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 5353 -GNinja \
5454 -DCMAKE_C_COMPILER_LAUNCHER=ccache \
5555 -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
56- -DCMAKE_BUILD_TYPE=Debug \
56+ -DCMAKE_C_COMPILER=clang \
57+ -DCMAKE_CXX_COMPILER=clang++ \
58+ -DCMAKE_BUILD_TYPE=Release \
5759 -DBUILD_TESTS=ON \
5860 -DCI_BUILD=ON \
5961 -DENABLE_COVERAGE=ON \
Original file line number Diff line number Diff line change @@ -42,8 +42,15 @@ if(ENABLE_COVERAGE)
4242 if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug" )
4343 message (WARNING "Coverage is enabled but not build in debug mode. Coverage results may be misleading." )
4444 endif ()
45- target_compile_options (nuclear PUBLIC -fprofile-arcs -ftest-coverage -fprofile-abs-path -fprofile-update=atomic )
46- target_link_options (nuclear PUBLIC -fprofile-arcs )
45+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
46+ target_compile_options (nuclear PUBLIC -fprofile-arcs -ftest-coverage -fprofile-abs-path -fprofile-update=atomic )
47+ target_link_options (nuclear PUBLIC -fprofile-arcs )
48+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
49+ target_compile_options (nuclear PUBLIC -fprofile-instr-generate -fcoverage-mapping )
50+ target_link_options (nuclear PUBLIC -fprofile-instr-generate )
51+ else ()
52+ message (FATAL_ERROR "Coverage is not supported for the current compiler." )
53+ endif ()
4754endif (ENABLE_COVERAGE )
4855
4956# Enable warnings, and all warnings are errors
You can’t perform that action at this time.
0 commit comments