Skip to content

Commit a496d1f

Browse files
oyvindronningstadgalak
authored andcommitted
CMakeLists.txt: Various cleanup
Mostly doc changes because the API has changed Signed-off-by: Øyvind Rønningstad <[email protected]>
1 parent a683f73 commit a496d1f

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

CMakeLists.txt

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
#
44
# SPDX-License-Identifier: Apache-2.0
55

6-
# Adds trusted-firmware-m as an external project, and provides output values
7-
# that are required to link against the secure TF-M binary.
6+
# Adds trusted-firmware-m as an external project.
7+
# Also creates a target called 'tfm_api'
8+
# which can be linked into the app.
89
#
910
# When called from a Zephyr module, the following input values can be provided
1011
# to configure the TF-M build:
@@ -18,12 +19,6 @@
1819
# REGRESSION: Boolean if TF-M build includes building the TF-M regression tests
1920
# BL2: Boolean if the TF-M build uses MCUboot.
2021
#
21-
# The following output values can also be used:
22-
#
23-
# OUT_VENEERS_FILE: The path and filename of the veneer library to link against,
24-
# which identifies where the veneer functions are in memory.
25-
# Should be added via "target_link_libraries"
26-
#
2722
# Example usage:
2823
#
2924
# trusted_firmware_build(BINARY_DIR ${CMAKE_BINARY_DIR}/tfm
@@ -33,10 +28,10 @@
3328
# ISOLATION_LEVEL 2
3429
# REGRESSION
3530
# BL2 True
36-
# BUILD_PROFILE profile_small
31+
# BUILD_PROFILE profile_small)
3732
function(trusted_firmware_build)
3833
set(options IPC REGRESSION)
39-
set(oneValueArgs BINARY_DIR BOARD OUT_INCLUDE_PATH BL2 ISOLATION_LEVEL CMAKE_BUILD_TYPE BUILD_PROFILE)
34+
set(oneValueArgs BINARY_DIR BOARD BL2 ISOLATION_LEVEL CMAKE_BUILD_TYPE BUILD_PROFILE)
4035
cmake_parse_arguments(TFM "${options}" "${oneValueArgs}" "" ${ARGN})
4136

4237
if(DEFINED TFM_BL2)
@@ -69,11 +64,14 @@ function(trusted_firmware_build)
6964

7065

7166
set(VENEERS_FILE ${TFM_BINARY_DIR}/secure_fw/s_veneers.o)
72-
set(${TFM_OUT_VENEERS_FILE} ${VENEERS_FILE} PARENT_SCOPE)
73-
set(${TFM_OUT_INCLUDE_PATH} ${TFM_BINARY_DIR}/install/export/tfm/include PARENT_SCOPE)
74-
7567
set(PSA_API_NS_PATH ${TFM_BINARY_DIR}/interface/libpsa_api_ns.a)
7668

69+
set(BUILD_BYPRODUCTS
70+
${VENEERS_FILE}
71+
${PSA_API_NS_PATH}
72+
${BL2_HEX_FILE}
73+
)
74+
7775
# Get the toolchain variant
7876
# TODO: Add support for cross-compile toolchain variant
7977
# TODO: Enforce GCC version check against TF-M compiler requirements
@@ -109,10 +107,9 @@ function(trusted_firmware_build)
109107
-DTFM_TOOLCHAIN_PREFIX=${TFM_TOOLCHAIN_PREFIX}
110108
BUILD_ALWAYS True
111109
USES_TERMINAL_BUILD True
112-
BUILD_BYPRODUCTS ${VENEERS_FILE} ${PSA_API_NS_PATH}
110+
BUILD_BYPRODUCTS ${BUILD_BYPRODUCTS}
113111
)
114112

115-
# IPC mode source dependencies
116113
add_library(tfm_api STATIC IMPORTED)
117114
set_target_properties(tfm_api PROPERTIES
118115
IMPORTED_LOCATION ${PSA_API_NS_PATH}

0 commit comments

Comments
 (0)