diff --git a/CMakeLists.txt b/CMakeLists.txt index 297eb90..5e1e2a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,15 @@ if(NOT_SUBPROJECT) if(NOT MSVC) target_compile_options(errors_test PRIVATE --coverage -O0 -fno-exceptions) target_link_options(errors_test PRIVATE --coverage) + + get_target_property(errors_test_SOURCES errors_test SOURCES) + foreach(SOURCE ${errors_test_SOURCES}) + set(GCDA ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/errors_test.dir/${SOURCE}.gcda) + add_custom_command( + TARGET errors_test PRE_LINK + COMMAND ${CMAKE_COMMAND} -E rm -f ${GCDA} + ) + endforeach() endif() catch_discover_tests(errors_test) diff --git a/components/format/CMakeLists.txt b/components/format/CMakeLists.txt index 70a1821..f319250 100644 --- a/components/format/CMakeLists.txt +++ b/components/format/CMakeLists.txt @@ -20,6 +20,15 @@ if(NOT_SUBPROJECT) if(NOT MSVC) target_compile_options(errors_format_test PRIVATE --coverage -O0 -fno-exceptions) target_link_options(errors_format_test PRIVATE --coverage) + + get_target_property(errors_format_test_SOURCES errors_format_test SOURCES) + foreach(SOURCE ${errors_format_test_SOURCES}) + set(GCDA ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/errors_format_test.dir/${SOURCE}.gcda) + add_custom_command( + TARGET errors_format_test PRE_LINK + COMMAND ${CMAKE_COMMAND} -E rm -f ${GCDA} + ) + endforeach() endif() catch_discover_tests(errors_format_test)