Skip to content

Commit 6edaaaa

Browse files
oyvindronningstadioannisg
authored andcommitted
CMakeLists.txt: Build TF-M based on new Kconfig options
Allow specifying options in Kconfig instead of via Cmake. This also allows TF-M to be enabled in subsystems, since the cmake function isn't available in subsystems, but the config is. Signed-off-by: Øyvind Rønningstad <[email protected]>
1 parent 83c964e commit 6edaaaa

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

CMakeLists.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,35 @@ function(trusted_firmware_build)
138138

139139
add_dependencies(tfm_api tfm)
140140
endfunction()
141+
142+
if (CONFIG_BUILD_WITH_TFM)
143+
if (CONFIG_TFM_IPC)
144+
set(TFM_IPC_ARG IPC)
145+
endif()
146+
if (CONFIG_TFM_REGRESSION)
147+
set(TFM_REGRESSION_ARG REGRESSION)
148+
endif()
149+
if (CONFIG_TFM_BL2_TRUE)
150+
set(TFM_BL2_ARG BL2 True)
151+
elseif (CONFIG_TFM_BL2_FALSE)
152+
set(TFM_BL2_ARG BL2 False)
153+
endif()
154+
if (CONFIG_TFM_ISOLATION_LEVEL)
155+
set(TFM_ISOLATION_LEVEL_ARG ISOLATION_LEVEL ${CONFIG_TFM_ISOLATION_LEVEL})
156+
endif()
157+
if (CONFIG_TFM_PROFILE)
158+
set(TFM_PROFILE_ARG BUILD_PROFILE ${CONFIG_TFM_PROFILE})
159+
endif()
160+
161+
trusted_firmware_build(
162+
BINARY_DIR ${CMAKE_BINARY_DIR}/tfm
163+
BOARD ${CONFIG_TFM_BOARD}
164+
${TFM_ISOLATION_LEVEL_ARG}
165+
${TFM_PROFILE_ARG}
166+
${TFM_BL2_ARG}
167+
${TFM_IPC_ARG}
168+
${TFM_REGRESSION_ARG}
169+
)
170+
171+
zephyr_link_libraries(tfm_api)
172+
endif()

0 commit comments

Comments
 (0)