From 875c0c33c3c3351fe59ba62ae01da5c427769ba0 Mon Sep 17 00:00:00 2001 From: Alexandre Plateau Date: Tue, 24 Sep 2024 11:04:38 +0200 Subject: [PATCH] feat(cmake): adding more flags for coverage --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7331cb23a..1cf3824f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -182,11 +182,11 @@ if (ARK_TESTS) target_compile_features(unittests PRIVATE cxx_std_20) target_compile_definitions(unittests PRIVATE ARK_TESTS_ROOT="${CMAKE_CURRENT_SOURCE_DIR}/") - if (ARK_COVERAGE AND NOT WIN32) - target_compile_options(unittests PRIVATE -coverage) - target_link_options(unittests PRIVATE -coverage) - target_compile_options(ArkReactor PRIVATE -coverage) - target_link_options(ArkReactor PRIVATE -coverage) + if (ARK_COVERAGE AND CMAKE_COMPILER_IS_CLANG) + target_compile_options(unittests PRIVATE -coverage -fcoverage-mapping -fprofile-instr-generate) + target_link_options(unittests PRIVATE -coverage -fcoverage-mapping -fprofile-instr-generate) + target_compile_options(ArkReactor PRIVATE -coverage -fcoverage-mapping -fprofile-instr-generate) + target_link_options(ArkReactor PRIVATE -coverage -fcoverage-mapping -fprofile-instr-generate) # find required tools find_program(LCOV lcov REQUIRED)