Skip to content

Commit 45f72fd

Browse files
committed
Fix linked objects for LLVM code coverage
A mis-named variable made it so no object was linked for LLVM code coverage builds.
1 parent 754e716 commit 45f72fd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Diff for: code-coverage.cmake

+6-6
Original file line numberDiff line numberDiff line change
@@ -306,14 +306,14 @@ function(target_code_coverage TARGET_NAME)
306306

307307
# If there are static or shared objects to also work with, generate the
308308
# string to add them here
309-
foreach(LINKED_OBJECT ${target_code_coverage_OBJECTS})
309+
foreach(LINK_OBJECT ${target_code_coverage_OBJECTS})
310310
# Check to see if the target is a shared object
311-
if(TARGET ${_TARGET})
312-
get_target_property(LINKED_OBJECT_TYPE ${LINKED_OBJECT} TYPE)
313-
if(${LINKED_OBJECT_TYPE} STREQUAL "STATIC_LIBRARY"
314-
OR ${LINKED_OBJECT_TYPE} STREQUAL "SHARED_LIBRARY")
311+
if(TARGET ${LINK_OBJECT})
312+
get_target_property(LINK_OBJECT_TYPE ${LINK_OBJECT} TYPE)
313+
if(${LINK_OBJECT_TYPE} STREQUAL "STATIC_LIBRARY"
314+
OR ${LINK_OBJECT_TYPE} STREQUAL "SHARED_LIBRARY")
315315
set(LINKED_OBJECTS ${LINKED_OBJECTS}
316-
-object=$<TARGET_FILE:${LINKED_OBJECT}>)
316+
-object=$<TARGET_FILE:${LINK_OBJECT}>)
317317
endif()
318318
endif()
319319
endforeach()

0 commit comments

Comments
 (0)