Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 1 | From 7f254bf14a97d14d19e61e2b8f8359bc238f3f1b Mon Sep 17 00:00:00 2001 |
| 2 | From: Anton Antonov <Anton.Antonov@arm.com> |
| 3 | Date: Wed, 31 Aug 2022 17:07:51 +0100 |
| 4 | Subject: [PATCH 3/4] Always define PSA_CRYPTO_API_INCLUDE |
| 5 | |
| 6 | PSA_CRYPTO_API_INCLUDE is not defined when pre-built mbedtls was used. |
| 7 | |
| 8 | Upstream-Status: Pending |
| 9 | Signed-off-by: Anton Antonov <Anton.Antonov@arm.com> |
| 10 | --- |
| 11 | external/MbedTLS/MbedTLS.cmake | 5 +++-- |
| 12 | 1 file changed, 3 insertions(+), 2 deletions(-) |
| 13 | |
| 14 | diff --git a/external/MbedTLS/MbedTLS.cmake b/external/MbedTLS/MbedTLS.cmake |
| 15 | index 3193a07..f15e25d 100644 |
| 16 | --- a/external/MbedTLS/MbedTLS.cmake |
| 17 | +++ b/external/MbedTLS/MbedTLS.cmake |
| 18 | @@ -96,8 +96,6 @@ if (NOT MBEDCRYPTO_LIB_FILE) |
| 19 | #Configure Mbed TLS to build only mbedcrypto lib |
| 20 | execute_process(COMMAND ${Python3_EXECUTABLE} scripts/config.py crypto WORKING_DIRECTORY ${MBEDTLS_SOURCE_DIR}) |
| 21 | |
| 22 | - # Advertise Mbed TLS as the provider of the psa crypto API |
| 23 | - set(PSA_CRYPTO_API_INCLUDE "${MBEDTLS_INSTALL_DIR}/include" CACHE STRING "PSA Crypto API include path") |
| 24 | |
| 25 | include(${TS_ROOT}/tools/cmake/common/PropertyCopy.cmake) |
| 26 | |
| 27 | @@ -157,6 +155,9 @@ if (NOT MBEDCRYPTO_LIB_FILE) |
| 28 | set(MBEDCRYPTO_LIB_FILE "${MBEDTLS_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}mbedcrypto${CMAKE_STATIC_LIBRARY_SUFFIX}") |
| 29 | endif() |
| 30 | |
| 31 | +# Advertise Mbed TLS as the provider of the psa crypto API |
| 32 | +set(PSA_CRYPTO_API_INCLUDE "${MBEDTLS_INSTALL_DIR}/include" CACHE STRING "PSA Crypto API include path") |
| 33 | + |
| 34 | #Create an imported target to have clean abstraction in the build-system. |
| 35 | add_library(mbedcrypto STATIC IMPORTED) |
| 36 | set_property(DIRECTORY ${CMAKE_SOURCE_DIR} APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${MBEDCRYPTO_LIB_FILE}) |
| 37 | -- |
| 38 | 2.25.1 |
| 39 | |