| 1 |
set(everest_target "${TF_PSA_CRYPTO_TARGET_PREFIX}everest") |
| 2 |
if (USE_STATIC_TF_PSA_CRYPTO_LIBRARY) |
| 3 |
set(everest_static_target ${everest_target}) |
| 4 |
endif() |
| 5 |
set(target_libraries ${everest_target}) |
| 6 |
if(USE_STATIC_TF_PSA_CRYPTO_LIBRARY AND USE_SHARED_TF_PSA_CRYPTO_LIBRARY) |
| 7 |
string(APPEND everest_static_target "_static") |
| 8 |
list(APPEND target_libraries ${everest_static_target}) |
| 9 |
endif() |
| 10 |
|
| 11 |
foreach (target IN LISTS target_libraries) |
| 12 |
add_library(${target} OBJECT |
| 13 |
library/x25519.c |
| 14 |
library/Hacl_Curve25519_joined.c) |
| 15 |
|
| 16 |
tf_psa_crypto_set_base_compile_options(${target}) |
| 17 |
target_include_directories(${target} |
| 18 |
PUBLIC include |
| 19 |
PRIVATE # Add the build-tree include directory before the source-tree one |
| 20 |
# so that generated headers in the build tree take precedence. |
| 21 |
${PROJECT_BINARY_DIR}/include |
| 22 |
${PROJECT_SOURCE_DIR}/include |
| 23 |
${TF_PSA_CRYPTO_DRIVERS_INCLUDE_DIRS} |
| 24 |
include/tf-psa-crypto/private/everest |
| 25 |
include/tf-psa-crypto/private/everest/kremlib |
| 26 |
${PROJECT_SOURCE_DIR}/core) |
| 27 |
tf_psa_crypto_set_config_files_compile_definitions(${target}) |
| 28 |
if(TF_PSA_CRYPTO_TEST_DRIVER) |
| 29 |
add_dependencies(${target} ${TF_PSA_CRYPTO_TEST_DRIVER_GENERATION_TARGETS}) |
| 30 |
endif() |
| 31 |
endforeach(target) |
| 32 |
|
| 33 |
if(USE_SHARED_TF_PSA_CRYPTO_LIBRARY) |
| 34 |
set_property(TARGET ${everest_target} PROPERTY POSITION_INDEPENDENT_CODE ON) |
| 35 |
endif(USE_SHARED_TF_PSA_CRYPTO_LIBRARY) |
| 36 |
|
| 37 |
if(INSTALL_TF_PSA_CRYPTO_HEADERS) |
| 38 |
|
| 39 |
install(DIRECTORY "include/" |
| 40 |
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} |
| 41 |
FILES_MATCHING |
| 42 |
PATTERN "*.h" |
| 43 |
) |
| 44 |
|
| 45 |
endif(INSTALL_TF_PSA_CRYPTO_HEADERS) |