Skip to content

Commit c5b4094

Browse files
ioannisggalak
authored andcommitted
modules: tf-m: do not expose TF-M NS interface include directories publicly
Instead of exposing publicly the TF-M NS interface include directories, we include them when we build relevant projects. This is required, as the TF-M include directories contains psa crypto sources that are also provided by the mbedtls crypto module. The downside of this solution is that the TF-M includes need to be added explicitly in each application that uses TF-M APIs. Signed-off-by: Ioannis Glaropoulos <[email protected]>
1 parent d0073fd commit c5b4094

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

modules/trusted-firmware-m/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,13 @@ function(trusted_firmware_build)
241241
zephyr_library_sources_ifndef(CONFIG_TFM_PSA_TEST_NONE src/zephyr_tfm_psa_test.c)
242242

243243
zephyr_include_directories(
244-
${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/trusted-firmware-m/interface/include
245244
${TFM_GENERATED_INCLUDES}
246245
)
247246

247+
target_include_directories(tfm_api PRIVATE
248+
${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/trusted-firmware-m/interface/include
249+
)
250+
248251
zephyr_library_link_libraries(
249252
${PSA_TEST_VAL_FILE}
250253
${PSA_TEST_PAL_FILE}

samples/tfm_integration/psa_level_1/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ target_sources(app PRIVATE src/shell.c)
1414
target_sources(app PRIVATE src/util_app_cfg.c)
1515
target_sources(app PRIVATE src/util_app_log.c)
1616
target_sources(app PRIVATE src/util_sformat.c)
17+
18+
target_include_directories(app PRIVATE
19+
${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/trusted-firmware-m/interface/include
20+
)

samples/tfm_integration/tfm_ipc/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
77
project(tfm_ipc)
88

99
target_sources(app PRIVATE src/main.c)
10+
11+
target_include_directories(app PRIVATE
12+
${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/trusted-firmware-m/interface/include
13+
)

samples/tfm_integration/tfm_psa_test/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
1111
project(tfm_psa_storage_test)
1212

1313
target_sources(app PRIVATE src/main.c)
14+
15+
target_include_directories(app PRIVATE
16+
${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/trusted-firmware-m/interface/include
17+
)

tests/arch/arm/arm_thread_swap_tz/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ project(NONE)
1111

1212
FILE(GLOB app_sources src/*.c)
1313
target_sources(app PRIVATE ${app_sources})
14+
15+
target_include_directories(app PRIVATE
16+
${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/trusted-firmware-m/interface/include
17+
)

0 commit comments

Comments
 (0)