Skip to content

Commit

Permalink
Removed double-run of ccoc targets
Browse files Browse the repository at this point in the history
In previous versions to get around issues on Windows, the running of
ccov targets was split to a separate custom target, and then later
re-merged with some processing commands.

This removes that extra split run of the targeted executable, so that it
will only be run just once.
  • Loading branch information
StableCoder committed Sep 6, 2021
1 parent 9bc4e0f commit 7eb72fb
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions code-coverage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -299,17 +299,9 @@ function(target_code_coverage TARGET_NAME)
endif()
endforeach()

# Run the executable, generating raw profile data
add_custom_target(
ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME}-1
COMMAND
${CMAKE_COMMAND} -E env
LLVM_PROFILE_FILE=${target_code_coverage_COVERAGE_TARGET_NAME}.profraw
$<TARGET_FILE:${TARGET_NAME}> ${target_code_coverage_ARGS}
DEPENDS ccov-preprocessing ccov-libs ${TARGET_NAME})

# Make the run data available for further processing. Separated to allow
# Windows to run this target serially.
# Run the executable, generating raw profile data Make the run data
# available for further processing. Separated to allow Windows to run
# this target serially.
add_custom_target(
ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME}
COMMAND
Expand All @@ -324,7 +316,7 @@ function(target_code_coverage TARGET_NAME)
"${CMAKE_CURRENT_BINARY_DIR}/${target_code_coverage_COVERAGE_TARGET_NAME}.profraw"
>> ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list
JOB_POOL ccov_serial_pool
DEPENDS ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME}-1)
DEPENDS ccov-preprocessing ccov-libs ${TARGET_NAME})

# Merge the generated profile data so llvm-cov can process it
add_custom_target(
Expand Down

0 comments on commit 7eb72fb

Please sign in to comment.