Make coverage optional for debug builds by introducing CHAOS_COVERAGE
flag.
This commit is contained in:
@@ -20,7 +20,7 @@ jobs:
|
|||||||
- name: Configure and build tests [Debug]
|
- name: Configure and build tests [Debug]
|
||||||
run: |
|
run: |
|
||||||
mkdir build-debug
|
mkdir build-debug
|
||||||
cmake -S . -B build-debug/ -D CMAKE_BUILD_TYPE=Debug
|
cmake -S . -B build-debug/ -D CMAKE_BUILD_TYPE=Debug -D CHAOS_COVERAGE=ON
|
||||||
cmake --build build-debug/ -t ChaosTests
|
cmake --build build-debug/ -t ChaosTests
|
||||||
|
|
||||||
- name: Configure and build benchmarks [Release]
|
- name: Configure and build benchmarks [Release]
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ target_include_directories(ChaosTests PRIVATE
|
|||||||
|
|
||||||
target_compile_options(ChaosTests PRIVATE -Wunused -Werror=unused)
|
target_compile_options(ChaosTests PRIVATE -Wunused -Werror=unused)
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
option(CHAOS_COVERAGE "Enable coverage" OFF)
|
||||||
|
|
||||||
|
if(CHAOS_COVERAGE)
|
||||||
target_compile_options(ChaosTests PRIVATE --coverage)
|
target_compile_options(ChaosTests PRIVATE --coverage)
|
||||||
target_link_options(ChaosTests PRIVATE --coverage)
|
target_link_options(ChaosTests PRIVATE --coverage)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user