Skip to content

Commit 01d9a08

Browse files
committed
DTNN-653 Fixed functional test cmake
DTNN-653 Added include dirs to functional test DTNN-653 Added link libs to functional test DTNN-653 Functional test compilation mods DTNN-653 Added bplib stubs to functional test DTNN-653 Fixed stubs name DTNN-653 Removed public from link_libraries DTNN-653 Removed bplib stubs DTNN-653 Added back bplib stubs DTNN-653 Functional test cmake fix DTNN-653 Functional test cmake fix 2 DTNN-653 Functional test cmake fix 3 DTNN-653 Functional test cmake fix 4 DTNN-653 Functional test cmake fix 5 DTNN-653 Functional test cmake fix 6 DTNN-653 Functional test cmake fix 7 DTNN-653 Functional test cmake fix 8 DTNN-653 Functional test cmake fix 9 DTNN-653 Functional test cmake fix 9 DTNN-653 Functional test cmake fix 9 DTNN-653 Functional test cmake fix 9 DTNN-653 Functional test cmake fix DTNN-653 Functional test cmake fix DTNN-653 Functional test cmake fix DTNN-653 Functional test cmake fix DTNN-653 Functional test cmake fix DTNN-653 Functional test cmake fix DTNN-653 Functional test cmake fix DTNN-653 Functional test cmake fix
1 parent d2ac800 commit 01d9a08

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

CMakeLists.txt

+18-14
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,6 @@ foreach(COMPONENT ${BPLIB_COMPONENTS})
120120

121121
endforeach()
122122

123-
# Link all stubs into single library
124-
add_library(coverage-bplib-stubs INTERFACE)
125-
126-
foreach(COMPONENT ${BPLIB_COMPONENTS})
127-
target_link_libraries(coverage-bplib-stubs INTERFACE ${COMPONENT}_stubs)
128-
endforeach()
129-
130123
# If building as part of CFE/CFS, then the "IS_CFS_ARCH_BUILD" should be set
131124
# this allows simply dropping this module into a CFS project
132125
if (IS_CFS_ARCH_BUILD)
@@ -193,18 +186,18 @@ endif()
193186

194187
get_target_property(IS_PIC bplib POSITION_INDEPENDENT_CODE)
195188
if (IS_PIC)
196-
foreach(COMPONENT ${BPLIB_COMPONENTS})
197-
set_target_properties(${COMPONENT} PROPERTIES POSITION_INDEPENDENT_CODE ${IS_PIC})
198-
endforeach()
189+
set_target_properties(${BPLIB_COMPONENTS} PROPERTIES POSITION_INDEPENDENT_CODE ${IS_PIC})
199190
endif()
200191

201192
# Set the standard compile options for all submodules (c99, full warnings)
202-
list(APPEND ${BPLIB_COMPONENTS} bplib)
203193
foreach(COMPONENT ${BPLIB_COMPONENTS})
204194
target_compile_features(${COMPONENT} PRIVATE c_std_99)
205195
target_compile_options(${COMPONENT} PRIVATE ${BPLIB_COMMON_COMPILE_OPTIONS})
206196
endforeach()
207197

198+
target_compile_features(bplib PRIVATE c_std_99)
199+
target_compile_options(bplib PRIVATE ${BPLIB_COMMON_COMPILE_OPTIONS})
200+
208201
# Internal/private header files exist within the implementation directories
209202
target_include_directories(bplib PRIVATE ${BPLIB_PRIVATE_INCLUDE_DIRS})
210203

@@ -218,6 +211,17 @@ target_include_directories(bplib PUBLIC
218211

219212
# BPLib Sanity checks are only for standalone builds, sanity checks
220213
# for CFE/CFS builds should be part of the BP app, as opposed to BPLib
221-
if (BPLIB_ENABLE_UNIT_TESTS AND NOT IS_CFS_ARCH_BUILD)
222-
add_subdirectory(ut-functional)
223-
endif ()
214+
if (BPLIB_ENABLE_UNIT_TESTS)
215+
216+
# Link all stubs into single library
217+
add_library(coverage-bplib-stubs INTERFACE)
218+
219+
foreach(COMPONENT ${BPLIB_COMPONENTS})
220+
target_link_libraries(coverage-bplib-stubs INTERFACE ${COMPONENT}_stubs)
221+
endforeach()
222+
223+
if (NOT IS_CFS_ARCH_BUILD)
224+
add_subdirectory(ut-functional)
225+
endif (NOT IS_CFS_ARCH_BUILD)
226+
227+
endif (BPLIB_ENABLE_UNIT_TESTS)

ut-functional/CMakeLists.txt

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
##################################################################
22
#
3-
# coverage test build recipe
3+
# Coverage test build recipe
44
#
55
# This CMake file contains the recipe for building the coverage tests.
66
# It is invoked from the parent directory when unit tests are enabled.
77
#
88
##################################################################
99

10+
set(CMAKE_VERBOSE_MAKEFILE ON)
11+
1012
# Add executable
1113
add_executable(functional-bplib_sanity-testrunner
1214
sanity-test.c
@@ -15,6 +17,10 @@ add_executable(functional-bplib_sanity-testrunner
1517
target_compile_features(functional-bplib_sanity-testrunner PUBLIC c_std_99)
1618
target_compile_options(functional-bplib_sanity-testrunner PUBLIC ${BPLIB_COMMON_COMPILE_OPTIONS})
1719

20+
target_include_directories(functional-bplib_sanity-testrunner PUBLIC
21+
$<TARGET_PROPERTY:bplib,INTERFACE_INCLUDE_DIRECTORIES>
22+
)
23+
1824
target_link_libraries(functional-bplib_sanity-testrunner PUBLIC
1925
bplib
2026
ut_assert
@@ -28,4 +34,4 @@ if (INSTALL_TARGET_LIST)
2834
foreach(TGT ${INSTALL_TARGET_LIST})
2935
install(TARGETS functional-bplib_sanity-testrunner DESTINATION ${TGT}/${UT_INSTALL_SUBDIR})
3036
endforeach()
31-
endif()
37+
endif()

0 commit comments

Comments
 (0)