2020-06-05 09:15:31 +00:00
|
|
|
set(executables
|
2022-01-31 12:27:39 +00:00
|
|
|
aead_demo
|
2020-06-05 09:15:31 +00:00
|
|
|
crypto_examples
|
2022-01-31 12:09:47 +00:00
|
|
|
hmac_demo
|
2020-06-05 09:15:31 +00:00
|
|
|
key_ladder_demo
|
|
|
|
psa_constant_names
|
2023-07-18 12:46:10 +00:00
|
|
|
psa_hash
|
2020-06-05 09:15:31 +00:00
|
|
|
)
|
2024-09-14 10:13:16 +00:00
|
|
|
add_dependencies(${programs_target} ${executables})
|
2018-07-10 07:10:21 +00:00
|
|
|
|
2021-10-20 16:14:23 +00:00
|
|
|
if(GEN_FILES)
|
2021-09-08 11:27:09 +00:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/psa_constant_names_generated.c
|
|
|
|
COMMAND
|
2021-10-20 15:53:58 +00:00
|
|
|
${MBEDTLS_PYTHON_EXECUTABLE}
|
2021-09-08 11:27:09 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/generate_psa_constants.py
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
WORKING_DIRECTORY
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../..
|
|
|
|
DEPENDS
|
2021-05-14 08:33:32 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/generate_psa_constants.py
|
2024-06-10 07:41:49 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../tf-psa-crypto/include/psa/crypto_values.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../tf-psa-crypto/include/psa/crypto_extra.h
|
2021-09-08 11:27:09 +00:00
|
|
|
)
|
|
|
|
else()
|
|
|
|
link_to_source(psa_constant_names_generated.c)
|
|
|
|
endif()
|
2021-05-14 08:33:32 +00:00
|
|
|
|
2020-06-05 09:15:31 +00:00
|
|
|
foreach(exe IN LISTS executables)
|
2020-06-05 14:00:22 +00:00
|
|
|
add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>)
|
2023-12-15 17:14:34 +00:00
|
|
|
target_link_libraries(${exe} ${mbedcrypto_target} ${CMAKE_THREAD_LIBS_INIT})
|
2020-06-05 14:00:22 +00:00
|
|
|
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
|
2020-06-05 09:15:31 +00:00
|
|
|
endforeach()
|
2019-01-02 16:28:46 +00:00
|
|
|
|
2020-05-28 07:42:01 +00:00
|
|
|
target_include_directories(psa_constant_names PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
2021-10-20 16:14:23 +00:00
|
|
|
if(GEN_FILES)
|
2021-09-08 11:27:09 +00:00
|
|
|
add_custom_target(generate_psa_constant_names_generated_c
|
|
|
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/psa_constant_names_generated.c)
|
|
|
|
add_dependencies(psa_constant_names generate_psa_constant_names_generated_c)
|
|
|
|
endif()
|
2019-01-02 16:29:04 +00:00
|
|
|
|
2020-06-05 09:15:31 +00:00
|
|
|
install(TARGETS ${executables}
|
2018-07-10 07:10:21 +00:00
|
|
|
DESTINATION "bin"
|
|
|
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
|
|
|
|
2019-01-02 16:28:46 +00:00
|
|
|
install(PROGRAMS
|
|
|
|
key_ladder_demo.sh
|
|
|
|
DESTINATION "bin")
|