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 <joakim.andersson@nordicsemi.no>
Signed-off-by: Markus Swarowsky <markus.swarowsky@nordicsemi.no>
This commit is contained in:
Joakim Andersson 2023-12-11 21:52:07 +01:00 committed by Carles Cufí
parent dc7613865d
commit 3398c98743

View file

@ -16,6 +16,12 @@ zephyr_interface_library_named(mbedTLS)
MBEDTLS_CONFIG_FILE="${CONFIG_MBEDTLS_CFG_FILE}"
)
if (CONFIG_BUILD_WITH_TFM)
target_include_directories(mbedTLS INTERFACE
$<TARGET_PROPERTY:tfm,TFM_BINARY_DIR>/api_ns/interface/include
)
endif()
# Add regular includes
target_include_directories(mbedTLS INTERFACE
${ZEPHYR_CURRENT_MODULE_DIR}/include
@ -107,7 +113,7 @@ zephyr_interface_library_named(mbedTLS)
zephyr_library_named(mbedTLSCrypto)
if (CONFIG_MBEDTLS_PSA_CRYPTO_C)
if (CONFIG_MBEDTLS_PSA_CRYPTO_C AND NOT CONFIG_BUILD_WITH_TFM)
list(APPEND crypto_source
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_aead.c
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_cipher.c
@ -119,11 +125,6 @@ zephyr_interface_library_named(mbedTLS)
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_se.c
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_storage.c
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_its_file.c
)
endif()
if (NOT CONFIG_BUILD_WITH_TFM)
list(APPEND crypto_source
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto.c
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_client.c
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_slot_management.c