From 17f8932f160f80ad5a1ae67bf866dc51c741ca25 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Mon, 22 Nov 2021 16:53:04 +0100 Subject: [PATCH] modules: trusted-firmware-m: Use TF-M install headers as interface Use the set of headers that the TF-M build system places in the install output. Not all public header files are available in the interface/include directory and the TF-M build system uses the install mechanism of cmake to include additional headers based on platform or configuration. Signed-off-by: Joakim Andersson --- modules/trusted-firmware-m/CMakeLists.txt | 2 +- samples/tfm_integration/psa_crypto/CMakeLists.txt | 2 +- .../tfm_integration/psa_protected_storage/CMakeLists.txt | 2 +- samples/tfm_integration/tfm_ipc/CMakeLists.txt | 2 +- samples/tfm_integration/tfm_psa_test/CMakeLists.txt | 2 +- .../tfm_integration/tfm_secure_partition/CMakeLists.txt | 2 +- tests/arch/arm/arm_thread_swap_tz/CMakeLists.txt | 8 +++++--- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/trusted-firmware-m/CMakeLists.txt b/modules/trusted-firmware-m/CMakeLists.txt index 6723e1b5c2b..f0f28ec212b 100644 --- a/modules/trusted-firmware-m/CMakeLists.txt +++ b/modules/trusted-firmware-m/CMakeLists.txt @@ -321,7 +321,7 @@ if (CONFIG_BUILD_WITH_TFM) ) target_include_directories(tfm_api PRIVATE - ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/interface/include + ${TFM_BINARY_DIR}/install/interface/include ) zephyr_library_link_libraries( diff --git a/samples/tfm_integration/psa_crypto/CMakeLists.txt b/samples/tfm_integration/psa_crypto/CMakeLists.txt index b4461a027de..17339b470b8 100644 --- a/samples/tfm_integration/psa_crypto/CMakeLists.txt +++ b/samples/tfm_integration/psa_crypto/CMakeLists.txt @@ -16,7 +16,7 @@ target_sources(app PRIVATE src/util_app_log.c) target_sources(app PRIVATE src/util_sformat.c) target_include_directories(app PRIVATE - ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/interface/include + $/install/interface/include ) # In TF-M, default value of CRYPTO_ENGINE_BUF_SIZE is 0x2080. It causes diff --git a/samples/tfm_integration/psa_protected_storage/CMakeLists.txt b/samples/tfm_integration/psa_protected_storage/CMakeLists.txt index 40bfae3263a..bbb8a2041fd 100644 --- a/samples/tfm_integration/psa_protected_storage/CMakeLists.txt +++ b/samples/tfm_integration/psa_protected_storage/CMakeLists.txt @@ -13,5 +13,5 @@ project(protected_storage) target_sources(app PRIVATE src/main.c) target_include_directories(app PRIVATE - ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/interface/include + $/install/interface/include ) diff --git a/samples/tfm_integration/tfm_ipc/CMakeLists.txt b/samples/tfm_integration/tfm_ipc/CMakeLists.txt index 0ac1e79b48f..f11b67af843 100644 --- a/samples/tfm_integration/tfm_ipc/CMakeLists.txt +++ b/samples/tfm_integration/tfm_ipc/CMakeLists.txt @@ -9,5 +9,5 @@ project(tfm_ipc) target_sources(app PRIVATE src/main.c) target_include_directories(app PRIVATE - ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/interface/include + $/install/interface/include ) diff --git a/samples/tfm_integration/tfm_psa_test/CMakeLists.txt b/samples/tfm_integration/tfm_psa_test/CMakeLists.txt index 080bfeb0231..9dcbf12ae64 100644 --- a/samples/tfm_integration/tfm_psa_test/CMakeLists.txt +++ b/samples/tfm_integration/tfm_psa_test/CMakeLists.txt @@ -13,5 +13,5 @@ project(tfm_psa_storage_test) target_sources(app PRIVATE src/main.c) target_include_directories(app PRIVATE - ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/interface/include + $/install/interface/include ) diff --git a/samples/tfm_integration/tfm_secure_partition/CMakeLists.txt b/samples/tfm_integration/tfm_secure_partition/CMakeLists.txt index 636ba5f1c19..262ac042c74 100644 --- a/samples/tfm_integration/tfm_secure_partition/CMakeLists.txt +++ b/samples/tfm_integration/tfm_secure_partition/CMakeLists.txt @@ -28,7 +28,7 @@ target_sources(app PRIVATE ) target_include_directories(app PRIVATE - ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/interface/include + $/install/interface/include ) target_compile_definitions(app diff --git a/tests/arch/arm/arm_thread_swap_tz/CMakeLists.txt b/tests/arch/arm/arm_thread_swap_tz/CMakeLists.txt index 56231233c97..93e91deafcb 100644 --- a/tests/arch/arm/arm_thread_swap_tz/CMakeLists.txt +++ b/tests/arch/arm/arm_thread_swap_tz/CMakeLists.txt @@ -12,6 +12,8 @@ project(NONE) FILE(GLOB app_sources src/*.c) target_sources(app PRIVATE ${app_sources}) -target_include_directories(app PRIVATE - ${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/interface/include -) +if (CONFIG_BUILD_WITH_TFM) + target_include_directories(app PRIVATE + $/install/interface/include + ) +endif()