Skip to content

Commit cd4009e

Browse files
committed
Add ccov-html-TARGET also for clang build
1 parent e95b081 commit cd4009e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

code-coverage.cmake

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ function(target_code_coverage TARGET_NAME)
346346
${LLVM_PROFDATA_PATH} merge -sparse
347347
${target_code_coverage_COVERAGE_TARGET_NAME}.profraw -o
348348
${target_code_coverage_COVERAGE_TARGET_NAME}.profdata
349-
DEPENDS ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME})
349+
DEPENDS)
350350

351351
# Ignore regex only works on LLVM >= 7
352352
if(LLVM_COV_VERSION VERSION_GREATER_EQUAL "7.0.0")
@@ -385,9 +385,9 @@ function(target_code_coverage TARGET_NAME)
385385
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/${target_code_coverage_COVERAGE_TARGET_NAME}.json
386386
DEPENDS ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME})
387387

388-
# Generates HTML output of the coverage information for perusal
388+
# Only generates HTML output of the coverage information for perusal
389389
add_custom_target(
390-
ccov-${target_code_coverage_COVERAGE_TARGET_NAME}
390+
ccov-html-${target_code_coverage_COVERAGE_TARGET_NAME}
391391
COMMAND
392392
${LLVM_COV_PATH} show $<TARGET_FILE:${TARGET_NAME}>
393393
-instr-profile=${target_code_coverage_COVERAGE_TARGET_NAME}.profdata
@@ -396,6 +396,15 @@ function(target_code_coverage TARGET_NAME)
396396
-format="html" ${LINKED_OBJECTS} ${EXCLUDE_REGEX}
397397
DEPENDS ccov-processing-${target_code_coverage_COVERAGE_TARGET_NAME})
398398

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+
399408
elseif(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES
400409
"GNU")
401410
set(COVERAGE_INFO
@@ -728,7 +737,7 @@ function(add_code_coverage_all_targets)
728737
add_custom_target(
729738
ccov-all
730739
COMMAND
731-
DEPENDS ccov-preprocessing ccov-all-processing ccov-all-clean ccov-all-html)
740+
DEPENDS ccov-preprocessing ccov-all-processing ccov-all-capture ccov-all-html)
732741

733742
endif()
734743

0 commit comments

Comments
 (0)