Skip to content

Tidy up cmake commands for coverage #5046

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU"
)
set(enable_coverage off CACHE BOOL "Build with coverage recording")
option(enable_coverage "Build with coverage recording")
set(parallel_tests "1" CACHE STRING "Number of tests to run in parallel")
if(${enable_coverage})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -g")
if(enable_coverage)
add_compile_options(--coverage -g)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage -g")
if (NOT DEFINED CODE_COVERAGE_OUTPUT_DIR)
set(CODE_COVERAGE_OUTPUT_DIR ${CMAKE_BINARY_DIR}/html)
Expand Down