@@ -161,13 +161,6 @@ if(CODE_COVERAGE AND NOT CODE_COVERAGE_ADDED)
161
161
# Targets
162
162
add_custom_target (ccov-clean)
163
163
164
- # Used to get the shared object file list before doing the main all-
165
- # processing
166
- add_custom_target (
167
- ccov-libs
168
- COMMAND ;
169
- COMMENT "libs ready for coverage report." )
170
-
171
164
elseif (CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES
172
165
"GNU" )
173
166
# Messages
@@ -315,35 +308,6 @@ function(target_code_coverage TARGET_NAME)
315
308
# Targets
316
309
get_target_property (target_type ${TARGET_NAME} TYPE )
317
310
318
- # Add shared library to processing for 'all' targets
319
- if (target_type STREQUAL "SHARED_LIBRARY" AND target_code_coverage_ALL)
320
- if (CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang"
321
- OR CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?[Cc]lang" )
322
- add_custom_command (
323
- OUTPUT
324
- ${CMAKE_COVERAGE_DATA_DIRECTORY} /objects/${target_code_coverage_COVERAGE_TARGET_NAME}
325
- COMMAND
326
- ${CMAKE_COMMAND} -E echo "-object=$<TARGET_FILE:${TARGET_NAME} >" >
327
- ${CMAKE_COVERAGE_DATA_DIRECTORY} /objects/${target_code_coverage_COVERAGE_TARGET_NAME}
328
- DEPENDS ${TARGET_NAME} )
329
- add_custom_target (
330
- ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME}
331
- DEPENDS
332
- ${CMAKE_COVERAGE_DATA_DIRECTORY} /objects/${target_code_coverage_COVERAGE_TARGET_NAME}
333
- )
334
-
335
- if (NOT TARGET ccov-libs)
336
- message (
337
- FATAL_ERROR
338
- "Calling target_code_coverage with 'ALL' must be after a call to 'add_code_coverage_all_targets'."
339
- )
340
- endif ()
341
-
342
- add_dependencies (ccov-libs
343
- ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME} )
344
- endif ()
345
- endif ()
346
-
347
311
# For executables add targets to run and produce output
348
312
if (target_type STREQUAL "EXECUTABLE" )
349
313
if (CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang"
@@ -398,7 +362,7 @@ function(target_code_coverage TARGET_NAME)
398
362
${CMAKE_COVERAGE_DATA_DIRECTORY} /profraw/${target_code_coverage_COVERAGE_TARGET_NAME}
399
363
COMMAND ${CMAKE_COMMAND} -E rm -f
400
364
${CMAKE_COVERAGE_DATA_DIRECTORY} /ccov-all .profdata
401
- DEPENDS ccov-libs ${TARGET_NAME} )
365
+ DEPENDS ${TARGET_NAME} )
402
366
add_custom_target (
403
367
ccov-run-${target_code_coverage_COVERAGE_TARGET_NAME}
404
368
DEPENDS ${target_code_coverage_COVERAGE_TARGET_NAME} .profraw)
0 commit comments