Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions modules/trusted-firmware-m/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,15 @@ if (CONFIG_BUILD_WITH_TFM)
if (CONFIG_TFM_PROFILE)
set(TFM_PROFILE_ARG BUILD_PROFILE ${CONFIG_TFM_PROFILE})
endif()
if (CONFIG_TFM_CMAKE_BUILD_TYPE_RELEASE)
set(TFM_CMAKE_BUILD_TYPE "Release")
elseif (CONFIG_TFM_CMAKE_BUILD_TYPE_MINSIZEREL)
set(TFM_CMAKE_BUILD_TYPE "MinSizeRel")
elseif (CONFIG_TFM_CMAKE_BUILD_TYPE_DEBUG)
set(TFM_CMAKE_BUILD_TYPE "Debug")
elseif (CONFIG_TFM_CMAKE_BUILD_TYPE_RELWITHDEBINFO)
set(TFM_CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()

trusted_firmware_build(
BINARY_DIR ${CMAKE_BINARY_DIR}/tfm
Expand All @@ -207,6 +216,7 @@ if (CONFIG_BUILD_WITH_TFM)
${TFM_BL2_ARG}
${TFM_IPC_ARG}
${TFM_REGRESSION_ARG}
CMAKE_BUILD_TYPE ${TFM_CMAKE_BUILD_TYPE}
)

zephyr_link_libraries(tfm_api)
Expand Down
21 changes: 21 additions & 0 deletions modules/trusted-firmware-m/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,27 @@ config TFM_PROFILE
profile_medium and profile_small. The default profile does not need
to have this configuration set.

choice TFM_CMAKE_BUILD_TYPE
prompt "The build type for TFM"
default TFM_CMAKE_BUILD_TYPE_RELEASE if SPEED_OPTIMIZATIONS && BUILD_OUTPUT_STRIPPED
default TFM_CMAKE_BUILD_TYPE_MINSIZEREL if SIZE_OPTIMIZATIONS
default TFM_CMAKE_BUILD_TYPE_DEBUG if DEBUG_OPTIMIZATIONS
default TFM_CMAKE_BUILD_TYPE_RELWITHDEBINFO

config TFM_CMAKE_BUILD_TYPE_RELEASE
bool "Release build"

config TFM_CMAKE_BUILD_TYPE_RELWITHDEBINFO
bool "Release build with Debug info"

config TFM_CMAKE_BUILD_TYPE_MINSIZEREL
bool "Release build, optimized for size"

config TFM_CMAKE_BUILD_TYPE_DEBUG
bool "Debug build"

endchoice

config TFM_ISOLATION_LEVEL
int "Isolation level setting."
range 1 3
Expand Down