Skip to content

Commit ecbf166

Browse files
joerchanVge0rge
authored andcommitted
[nrf fromtree] modules: mbedtls: Use TF-M PSA API headers
Use TF-M PSA API headers when compiling with TF-M enabled. Fixes: #43249 Signed-off-by: Joakim Andersson <[email protected]> Signed-off-by: Markus Swarowsky <[email protected]> (cherry picked from commit 3398c98) Signed-off-by: Markus Swarowsky <[email protected]>
1 parent 2b897f3 commit ecbf166

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

modules/mbedtls/CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ zephyr_interface_library_named(mbedTLS)
1616
MBEDTLS_CONFIG_FILE="${CONFIG_MBEDTLS_CFG_FILE}"
1717
)
1818

19+
if (CONFIG_BUILD_WITH_TFM)
20+
target_include_directories(mbedTLS INTERFACE
21+
$<TARGET_PROPERTY:tfm,TFM_BINARY_DIR>/api_ns/interface/include
22+
)
23+
endif()
24+
1925
# Add regular includes
2026
target_include_directories(mbedTLS INTERFACE
2127
${ZEPHYR_CURRENT_MODULE_DIR}/include
@@ -110,7 +116,7 @@ zephyr_interface_library_named(mbedTLS)
110116

111117
zephyr_library_named(mbedTLSCrypto)
112118

113-
if (CONFIG_MBEDTLS_PSA_CRYPTO_C)
119+
if (CONFIG_MBEDTLS_PSA_CRYPTO_C AND NOT CONFIG_BUILD_WITH_TFM)
114120
list(APPEND crypto_source
115121
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_aead.c
116122
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_cipher.c
@@ -122,11 +128,6 @@ zephyr_interface_library_named(mbedTLS)
122128
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_se.c
123129
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_storage.c
124130
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_its_file.c
125-
)
126-
endif()
127-
128-
if (NOT CONFIG_BUILD_WITH_TFM)
129-
list(APPEND crypto_source
130131
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto.c
131132
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_client.c
132133
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_slot_management.c

0 commit comments

Comments
 (0)