Skip to content

Commit 2c1576a

Browse files
committed
Remove ccov-preprocessing target
The only purpose of the job was to create the 'ccov' directory in the binary directory to store all the generated code coverage files. Rather than generating the directory at build time using a target,t he directory is now created at CMake generation time, meaning the build- time target is no longer necessary.
1 parent bc99f5b commit 2c1576a

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

Diff for: code-coverage.cmake

+8-12
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,7 @@ if(CODE_COVERAGE AND NOT CODE_COVERAGE_ADDED)
9696
set(CODE_COVERAGE_ADDED ON)
9797

9898
# Common Targets
99-
add_custom_target(
100-
ccov-preprocessing
101-
COMMAND ${CMAKE_COMMAND} -E make_directory
102-
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}
103-
DEPENDS ccov-clean)
99+
file(MAKE_DIRECTORY ${CMAKE_COVERAGE_OUTPUT_DIRECTORY})
104100

105101
if(CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang"
106102
OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang")
@@ -276,7 +272,7 @@ function(target_code_coverage TARGET_NAME)
276272
COMMAND
277273
${CMAKE_COMMAND} -E echo "-object=$<TARGET_FILE:${TARGET_NAME}>" >>
278274
${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/binaries.list
279-
DEPENDS ccov-preprocessing ${TARGET_NAME})
275+
DEPENDS ${TARGET_NAME})
280276

281277
if(NOT TARGET ccov-libs)
282278
message(
@@ -324,7 +320,7 @@ function(target_code_coverage TARGET_NAME)
324320
"${CMAKE_CURRENT_BINARY_DIR}/${target_code_coverage_COVERAGE_TARGET_NAME}.profraw"
325321
>> ${CMAKE_COVERAGE_OUTPUT_DIRECTORY}/profraw.list
326322
JOB_POOL ccov_serial_pool
327-
DEPENDS ccov-preprocessing ccov-libs ${TARGET_NAME})
323+
DEPENDS ccov-libs ${TARGET_NAME})
328324

329325
# Merge the generated profile data so llvm-cov can process it
330326
add_custom_target(
@@ -393,7 +389,7 @@ function(target_code_coverage TARGET_NAME)
393389
add_custom_target(
394390
ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME}
395391
COMMAND $<TARGET_FILE:${TARGET_NAME}> ${target_code_coverage_ARGS}
396-
DEPENDS ccov-preprocessing ${TARGET_NAME})
392+
DEPENDS ${TARGET_NAME})
397393

398394
# Generate exclusion string for use
399395
foreach(EXCLUDE_ITEM ${target_code_coverage_EXCLUDE})
@@ -424,7 +420,7 @@ function(target_code_coverage TARGET_NAME)
424420
${CMAKE_SOURCE_DIR} --capture ${EXTERNAL_OPTION} --output-file
425421
${COVERAGE_INFO}
426422
COMMAND ${EXCLUDE_COMMAND}
427-
DEPENDS ccov-preprocessing ${TARGET_NAME})
423+
DEPENDS ${TARGET_NAME})
428424
else()
429425
add_custom_target(
430426
ccov-capture-${target_code_coverage_COVERAGE_TARGET_NAME}
@@ -436,7 +432,7 @@ function(target_code_coverage TARGET_NAME)
436432
${CMAKE_SOURCE_DIR} --capture ${EXTERNAL_OPTION} --output-file
437433
${COVERAGE_INFO}
438434
COMMAND ${EXCLUDE_COMMAND}
439-
DEPENDS ccov-preprocessing ${TARGET_NAME})
435+
DEPENDS ${TARGET_NAME})
440436
endif()
441437

442438
# Generates HTML output of the coverage information for perusal
@@ -644,15 +640,15 @@ function(add_code_coverage_all_targets)
644640
COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --capture
645641
--output-file ${COVERAGE_INFO}
646642
COMMAND ${EXCLUDE_COMMAND}
647-
DEPENDS ccov-preprocessing ccov-all-processing)
643+
DEPENDS ccov-all-processing)
648644
else()
649645
add_custom_target(
650646
ccov-all-capture
651647
COMMAND ${CMAKE_COMMAND} -E rm -f ${COVERAGE_INFO}
652648
COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --capture
653649
--output-file ${COVERAGE_INFO}
654650
COMMAND ${EXCLUDE_COMMAND}
655-
DEPENDS ccov-preprocessing ccov-all-processing)
651+
DEPENDS ccov-all-processing)
656652
endif()
657653

658654
# Generates HTML output of all targets for perusal

0 commit comments

Comments
 (0)