Skip to content

Commit de2fa29

Browse files
Luiskyrzr
authored andcommitted
libs2/tf: SWPROT-8720: move unity and cmock lib build in TestFramework (#57)
(cherry picked from commit 18907993164d71d8fba9a276a6df682ab6b9fd89) Forwarded: #57 Relate-to: #50 Signed-off-by: Philippe Coval <philippe.coval@silabs.com>
1 parent bb763c7 commit de2fa29

File tree

1 file changed

+11
-0
lines changed
  • applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework

1 file changed

+11
-0
lines changed

applications/zpc/components/zwave/zwave_transports/s2/libs/zw-libs2/TestFramework/CMakeLists.txt

+11
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,17 @@ if (NOT COMMAND ADD_UNITY_TEST)
103103
endif()
104104
endfunction(ADD_UNITY_TEST)
105105

106+
# compile the unity version bundled along with cmock sources.
107+
add_library(unity cmock/vendor/unity/src/unity.c)
108+
target_include_directories(unity PUBLIC cmock/vendor/unity/src)
109+
target_compile_options(unity PRIVATE "-fPIC")
110+
111+
# Build the cmock library and link the above compiled unity with the cmock library
112+
add_library(cmock STATIC cmock/src/cmock.c)
113+
target_include_directories(cmock PUBLIC cmock/src)
114+
target_link_libraries(cmock PUBLIC unity)
115+
target_compile_options(cmock PRIVATE "-fPIC")
116+
106117
# Check whether the building of mock framework is disabled.
107118
# Building of the mock framework can be disabled by chip vendors simply by adding the following line to the specific project at higher level:
108119
# e.g.: set(DISABLE_MOCK 1)

0 commit comments

Comments
 (0)