Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 1 | set(executables |
| 2 | crypto_examples |
| 3 | key_ladder_demo |
| 4 | psa_constant_names |
| 5 | ) |
itayzafrir | a3ff8a6 | 2018-07-10 10:10:21 +0300 | [diff] [blame] | 6 | |
Manuel Pégourié-Gonnard | e90e405 | 2021-09-08 13:27:09 +0200 | [diff] [blame^] | 7 | if(DEV_MODE) |
| 8 | add_custom_command( |
| 9 | OUTPUT |
| 10 | ${CMAKE_CURRENT_BINARY_DIR}/psa_constant_names_generated.c |
| 11 | COMMAND |
| 12 | ${PYTHON} |
| 13 | ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/generate_psa_constants.py |
| 14 | ${CMAKE_CURRENT_BINARY_DIR} |
| 15 | WORKING_DIRECTORY |
| 16 | ${CMAKE_CURRENT_SOURCE_DIR}/../.. |
| 17 | DEPENDS |
Manuel Pégourié-Gonnard | 15a42c3 | 2021-05-14 10:33:32 +0200 | [diff] [blame] | 18 | ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/generate_psa_constants.py |
Manuel Pégourié-Gonnard | e90e405 | 2021-09-08 13:27:09 +0200 | [diff] [blame^] | 19 | ${CMAKE_CURRENT_SOURCE_DIR}/../../include/psa/crypto_values.h |
| 20 | ${CMAKE_CURRENT_SOURCE_DIR}/../../include/psa/crypto_extra.h |
| 21 | ) |
| 22 | else() |
| 23 | link_to_source(psa_constant_names_generated.c) |
| 24 | endif() |
Manuel Pégourié-Gonnard | 15a42c3 | 2021-05-14 10:33:32 +0200 | [diff] [blame] | 25 | |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 26 | foreach(exe IN LISTS executables) |
Ronald Cron | 8dc0af2 | 2020-06-05 16:00:22 +0200 | [diff] [blame] | 27 | add_executable(${exe} ${exe}.c $<TARGET_OBJECTS:mbedtls_test>) |
Raef Coles | 995c66f | 2020-10-13 16:30:41 +0100 | [diff] [blame] | 28 | target_link_libraries(${exe} ${mbedcrypto_target}) |
Ronald Cron | 8dc0af2 | 2020-06-05 16:00:22 +0200 | [diff] [blame] | 29 | target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include) |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 30 | endforeach() |
Gilles Peskine | f31dbb7 | 2019-01-02 17:28:46 +0100 | [diff] [blame] | 31 | |
Hugues de Valon | 235c72d | 2020-05-28 08:42:01 +0100 | [diff] [blame] | 32 | target_include_directories(psa_constant_names PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) |
Manuel Pégourié-Gonnard | e90e405 | 2021-09-08 13:27:09 +0200 | [diff] [blame^] | 33 | if(DEV_MODE) |
| 34 | add_custom_target(generate_psa_constant_names_generated_c |
| 35 | DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/psa_constant_names_generated.c) |
| 36 | add_dependencies(psa_constant_names generate_psa_constant_names_generated_c) |
| 37 | endif() |
Gilles Peskine | 6a78573 | 2019-01-02 17:29:04 +0100 | [diff] [blame] | 38 | |
Ronald Cron | bfd45f1 | 2020-06-05 11:15:31 +0200 | [diff] [blame] | 39 | install(TARGETS ${executables} |
itayzafrir | a3ff8a6 | 2018-07-10 10:10:21 +0300 | [diff] [blame] | 40 | DESTINATION "bin" |
| 41 | PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) |
| 42 | |
Gilles Peskine | f31dbb7 | 2019-01-02 17:28:46 +0100 | [diff] [blame] | 43 | install(PROGRAMS |
| 44 | key_ladder_demo.sh |
| 45 | DESTINATION "bin") |