CMake: Move library options to the top CMakeLists.txt
Move library options to the top CMakeLists.txt.
That way:
- we will be able to set the TF-PSA-Crypto
library options according to the Mbed TLS ones.
- we can define the crypto library target names
in the top CMakeLists.txt and not in the library
one that is dedicated to the TLS and x509
libraries now.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
index 0f75822..24c4de6 100644
--- a/library/CMakeLists.txt
+++ b/library/CMakeLists.txt
@@ -1,8 +1,3 @@
-option(USE_STATIC_MBEDTLS_LIBRARY "Build Mbed TLS static library." ON)
-option(USE_SHARED_MBEDTLS_LIBRARY "Build Mbed TLS shared library." OFF)
-option(LINK_WITH_PTHREAD "Explicitly link Mbed TLS library to pthread." OFF)
-option(LINK_WITH_TRUSTED_STORAGE "Explicitly link Mbed TLS library to trusted_storage." OFF)
-
# Set the project root directory if it's not already defined, as may happen if
# the library folder is included directly by a parent project, without
# including the top level CMakeLists.txt.
@@ -251,16 +246,13 @@
set(mbedtls_target "${MBEDTLS_TARGET_PREFIX}mbedtls")
set(mbedx509_target "${MBEDTLS_TARGET_PREFIX}mbedx509")
-set(mbedcrypto_target "${MBEDTLS_TARGET_PREFIX}mbedcrypto")
set(mbedtls_target ${mbedtls_target} PARENT_SCOPE)
set(mbedx509_target ${mbedx509_target} PARENT_SCOPE)
-set(mbedcrypto_target ${mbedcrypto_target} PARENT_SCOPE)
if (USE_STATIC_MBEDTLS_LIBRARY)
- set(mbedtls_static_target ${mbedtls_target})
- set(mbedx509_static_target ${mbedx509_target})
- set(mbedcrypto_static_target ${mbedcrypto_target})
+ set(mbedtls_static_target ${mbedtls_target})
+ set(mbedx509_static_target ${mbedx509_target})
endif()
set(target_libraries ${mbedcrypto_target} ${mbedx509_target} ${mbedtls_target})
@@ -268,7 +260,6 @@
if(USE_STATIC_MBEDTLS_LIBRARY AND USE_SHARED_MBEDTLS_LIBRARY)
string(APPEND mbedtls_static_target "_static")
string(APPEND mbedx509_static_target "_static")
- string(APPEND mbedcrypto_static_target "_static")
list(APPEND target_libraries
${mbedcrypto_static_target}