Skip to content

Commit 7eb72fb

Browse files
committed
Removed double-run of ccoc targets
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.
1 parent 9bc4e0f commit 7eb72fb

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

code-coverage.cmake

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -299,17 +299,9 @@ function(target_code_coverage TARGET_NAME)
299299
endif()
300300
endforeach()
301301

302-
# Run the executable, generating raw profile data
303-
add_custom_target(
304-
ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME}-1
305-
COMMAND
306-
${CMAKE_COMMAND} -E env
307-
LLVM_PROFILE_FILE=${target_code_coverage_COVERAGE_TARGET_NAME}.profraw
308-
$<TARGET_FILE:${TARGET_NAME}> ${target_code_coverage_ARGS}
309-
DEPENDS ccov-preprocessing ccov-libs ${TARGET_NAME})
310-
311-
# Make the run data available for further processing. Separated to allow
312-
# Windows to run this target serially.
302+
# Run the executable, generating raw profile data Make the run data
303+
# available for further processing. Separated to allow Windows to run
304+
# this target serially.
313305
add_custom_target(
314306
ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME}
315307
COMMAND
@@ -324,7 +316,7 @@ function(target_code_coverage TARGET_NAME)
324316
"${CMAKE_CURRENT_BINARY_DIR}/${target_code_coverage_COVERAGE_TARGET_NAME}.profraw"
325317
>> ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list
326318
JOB_POOL ccov_serial_pool
327-
DEPENDS ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME}-1)
319+
DEPENDS ccov-preprocessing ccov-libs ${TARGET_NAME})
328320

329321
# Merge the generated profile data so llvm-cov can process it
330322
add_custom_target(

0 commit comments

Comments
 (0)