@@ -346,7 +346,7 @@ function(target_code_coverage TARGET_NAME)
346
346
${LLVM_PROFDATA_PATH} merge -sparse
347
347
${target_code_coverage_COVERAGE_TARGET_NAME} .profraw -o
348
348
${target_code_coverage_COVERAGE_TARGET_NAME} .profdata
349
- DEPENDS ccov-run- ${target_code_coverage_COVERAGE_TARGET_NAME} )
349
+ DEPENDS )
350
350
351
351
# Ignore regex only works on LLVM >= 7
352
352
if (LLVM_COV_VERSION VERSION_GREATER_EQUAL "7.0.0" )
@@ -385,9 +385,9 @@ function(target_code_coverage TARGET_NAME)
385
385
${CMAKE_COVERAGE_OUTPUT_DIRECTORY} /${target_code_coverage_COVERAGE_TARGET_NAME} .json
386
386
DEPENDS ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME} )
387
387
388
- # Generates HTML output of the coverage information for perusal
388
+ # Only generates HTML output of the coverage information for perusal
389
389
add_custom_target (
390
- ccov-${target_code_coverage_COVERAGE_TARGET_NAME}
390
+ ccov-html- ${target_code_coverage_COVERAGE_TARGET_NAME}
391
391
COMMAND
392
392
${LLVM_COV_PATH} show $<TARGET_FILE:${TARGET_NAME} >
393
393
-instr-profile=${target_code_coverage_COVERAGE_TARGET_NAME} .profdata
@@ -396,6 +396,15 @@ function(target_code_coverage TARGET_NAME)
396
396
-format="html" ${LINKED_OBJECTS} ${EXCLUDE_REGEX}
397
397
DEPENDS ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME} )
398
398
399
+ # Generates HTML output of the coverage information for perusal
400
+ add_custom_target (
401
+ ccov-${target_code_coverage_COVERAGE_TARGET_NAME}
402
+ COMMAND
403
+ DEPENDS
404
+ ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME}
405
+ ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME}
406
+ ccov-html-${target_code_coverage_COVERAGE_TARGET_NAME} )
407
+
399
408
elseif (CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES
400
409
"GNU" )
401
410
set (COVERAGE_INFO
@@ -726,7 +735,7 @@ function(add_code_coverage_all_targets)
726
735
add_custom_target (
727
736
ccov-all
728
737
COMMAND
729
- DEPENDS ccov-preprocessing ccov-all -processing ccov-all -clean ccov-all -html)
738
+ DEPENDS ccov-preprocessing ccov-all -processing ccov-all -capture ccov-all -html)
730
739
731
740
endif ()
732
741
endif ()
0 commit comments