Skip to content

Commit d0cbe69

Browse files
committed
Right-scope the ccov-clean-TARGET GCC targets
Currently the targets were cleaning, then re-running and processing the coverage data. Now it follows it's namesake of just cleaning the coverage data files, and resetting the counters. Also applies to the ccov-all-clean GCC target.
1 parent 4d715b9 commit d0cbe69

File tree

1 file changed

+4
-26
lines changed

1 file changed

+4
-26
lines changed

code-coverage.cmake

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -485,30 +485,12 @@ function(target_code_coverage TARGET_NAME)
485485
add_custom_target(
486486
ccov-clean-${target_code_coverage_COVERAGE_TARGET_NAME}
487487
COMMAND ${CMAKE_COMMAND} -E remove -f ${COVERAGE_INFO}
488-
COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --zerocounters
489-
COMMAND
490-
${CMAKE_CROSSCOMPILING_EMULATOR} ${target_code_coverage_PRE_ARGS}
491-
$<TARGET_FILE:${TARGET_NAME}> ${target_code_coverage_ARGS}
492-
COMMAND
493-
${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --base-directory
494-
${CMAKE_SOURCE_DIR} --capture ${EXTERNAL_OPTION} --output-file
495-
${COVERAGE_INFO}
496-
COMMAND ${EXCLUDE_COMMAND}
497-
DEPENDS ${TARGET_NAME})
488+
COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --zerocounters)
498489
else()
499490
add_custom_target(
500491
ccov-clean-${target_code_coverage_COVERAGE_TARGET_NAME}
501492
COMMAND ${CMAKE_COMMAND} -E rm -f ${COVERAGE_INFO}
502-
COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --zerocounters
503-
COMMAND
504-
${CMAKE_CROSSCOMPILING_EMULATOR} ${target_code_coverage_PRE_ARGS}
505-
$<TARGET_FILE:${TARGET_NAME}> ${target_code_coverage_ARGS}
506-
COMMAND
507-
${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --base-directory
508-
${CMAKE_SOURCE_DIR} --capture ${EXTERNAL_OPTION} --output-file
509-
${COVERAGE_INFO}
510-
COMMAND ${EXCLUDE_COMMAND}
511-
DEPENDS ${TARGET_NAME})
493+
COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --zerocounters)
512494
endif()
513495

514496
add_custom_target(
@@ -747,17 +729,13 @@ function(add_code_coverage_all_targets)
747729
add_custom_target(
748730
ccov-all-clean
749731
COMMAND ${CMAKE_COMMAND} -E remove -f ${COVERAGE_INFO}
750-
COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --capture
751-
--output-file ${COVERAGE_INFO}
752-
COMMAND ${EXCLUDE_COMMAND}
732+
COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --zerocounters
753733
DEPENDS ccov-all-processing)
754734
else()
755735
add_custom_target(
756736
ccov-all-clean
757737
COMMAND ${CMAKE_COMMAND} -E rm -f ${COVERAGE_INFO}
758-
COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --capture
759-
--output-file ${COVERAGE_INFO}
760-
COMMAND ${EXCLUDE_COMMAND}
738+
COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --zerocounters
761739
DEPENDS ccov-all-processing)
762740
endif()
763741

0 commit comments

Comments
 (0)