@@ -42,14 +42,13 @@ foreach(MODULE ${CFE_CORE_MODULES})
42
42
43
43
# Compile the unit(s) under test as an object library
44
44
# this allows easy configuration of special flags and include paths
45
- # in particular this should use the UT_C_FLAGS for coverage instrumentation
45
+ # in particular this should use the UT_COVERAGE_COMPILE_FLAGS for coverage instrumentation
46
46
add_library (ut_${UT_TARGET_NAME} _object OBJECT
47
47
${CFE_MODULE_FILES} )
48
48
49
- # Apply the UT_C_FLAGS to the units under test
49
+ # Apply the UT_COVERAGE_COMPILE_FLAGS to the units under test
50
50
# This should enable coverage analysis on platforms that support this
51
- set_target_properties (ut_${UT_TARGET_NAME} _object PROPERTIES
52
- COMPILE_FLAGS "${UT_C_FLAGS} " )
51
+ target_compile_options (ut_${UT_TARGET_NAME} _object PRIVATE ${UT_COVERAGE_COMPILE_FLAGS} )
53
52
54
53
# For this object target only, the "override" includes should be injected
55
54
# into the include path BEFORE any other include path. This is so the
@@ -61,16 +60,14 @@ foreach(MODULE ${CFE_CORE_MODULES})
61
60
${MODULE} _UT.c
62
61
$<TARGET_OBJECTS:ut_${UT_TARGET_NAME} _object>)
63
62
63
+ # Also add the UT_COVERAGE_LINK_FLAGS to the link command
64
+ # This should enable coverage analysis on platforms that support this
64
65
target_link_libraries (${UT_TARGET_NAME} _UT
66
+ ${UT_COVERAGE_LINK_FLAGS}
65
67
ut_${CFE_CORE_TARGET} _support
66
68
ut_cfe-core_stubs
67
69
ut_assert)
68
70
69
- # Also add the C FLAGS to the link command
70
- # This should enable coverage analysis on platforms that support this
71
- set_target_properties (${UT_TARGET_NAME} _UT PROPERTIES
72
- LINK_FLAGS "${UT_C_FLAGS} " )
73
-
74
71
add_test (${UT_TARGET_NAME} _UT ${UT_TARGET_NAME} _UT)
75
72
install (TARGETS ${UT_TARGET_NAME} _UT DESTINATION ${TGTNAME} /${UT_INSTALL_SUBDIR} )
76
73
endforeach (MODULE ${CFE_CORE_MODULES} )
0 commit comments