File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
modules/trusted-firmware-m Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,15 @@ if (CONFIG_BUILD_WITH_TFM)
198198 if (CONFIG_TFM_PROFILE)
199199 set (TFM_PROFILE_ARG BUILD_PROFILE ${CONFIG_TFM_PROFILE} )
200200 endif ()
201+ if (CONFIG_TFM_CMAKE_BUILD_TYPE_RELEASE)
202+ set (TFM_CMAKE_BUILD_TYPE "Release" )
203+ elseif (CONFIG_TFM_CMAKE_BUILD_TYPE_MINSIZEREL)
204+ set (TFM_CMAKE_BUILD_TYPE "MinSizeRel" )
205+ elseif (CONFIG_TFM_CMAKE_BUILD_TYPE_DEBUG)
206+ set (TFM_CMAKE_BUILD_TYPE "Debug" )
207+ elseif (CONFIG_TFM_CMAKE_BUILD_TYPE_RELWITHDEBINFO)
208+ set (TFM_CMAKE_BUILD_TYPE "RelWithDebInfo" )
209+ endif ()
201210
202211 trusted_firmware_build(
203212 BINARY_DIR ${CMAKE_BINARY_DIR} /tfm
@@ -207,6 +216,7 @@ if (CONFIG_BUILD_WITH_TFM)
207216 ${TFM_BL2_ARG}
208217 ${TFM_IPC_ARG}
209218 ${TFM_REGRESSION_ARG}
219+ CMAKE_BUILD_TYPE ${TFM_CMAKE_BUILD_TYPE}
210220 )
211221
212222 zephyr_link_libraries(tfm_api)
Original file line number Diff line number Diff line change @@ -69,6 +69,27 @@ config TFM_PROFILE
6969 profile_medium and profile_small. The default profile does not need
7070 to have this configuration set.
7171
72+ choice TFM_CMAKE_BUILD_TYPE
73+ prompt "The build type for TFM"
74+ default TFM_CMAKE_BUILD_TYPE_RELEASE if SPEED_OPTIMIZATIONS && BUILD_OUTPUT_STRIPPED
75+ default TFM_CMAKE_BUILD_TYPE_MINSIZEREL if SIZE_OPTIMIZATIONS
76+ default TFM_CMAKE_BUILD_TYPE_DEBUG if DEBUG_OPTIMIZATIONS
77+ default TFM_CMAKE_BUILD_TYPE_RELWITHDEBINFO
78+
79+ config TFM_CMAKE_BUILD_TYPE_RELEASE
80+ bool "Release build"
81+
82+ config TFM_CMAKE_BUILD_TYPE_RELWITHDEBINFO
83+ bool "Release build with Debug info"
84+
85+ config TFM_CMAKE_BUILD_TYPE_MINSIZEREL
86+ bool "Release build, optimized for size"
87+
88+ config TFM_CMAKE_BUILD_TYPE_DEBUG
89+ bool "Debug build"
90+
91+ endchoice
92+
7293config TFM_ISOLATION_LEVEL
7394 int "Isolation level setting."
7495 range 1 3
You can’t perform that action at this time.
0 commit comments