From 21b33b07dfd8f30a08fc4654c2debcc0f166a5c8 Mon Sep 17 00:00:00 2001 From: Darryl Green Date: Thu, 7 Feb 2019 10:50:49 +0000 Subject: [PATCH] Run generate_psa_constants.py before building psa_constant_names with cmake --- programs/psa/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/programs/psa/CMakeLists.txt b/programs/psa/CMakeLists.txt index ab11fbc90..c80043bc4 100644 --- a/programs/psa/CMakeLists.txt +++ b/programs/psa/CMakeLists.txt @@ -4,11 +4,16 @@ target_link_libraries(crypto_examples mbedtls) add_executable(key_ladder_demo key_ladder_demo.c) target_link_libraries(key_ladder_demo mbedtls) -execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/generate_psa_constants.py) - add_executable(psa_constant_names psa_constant_names.c) target_link_libraries(psa_constant_names mbedtls) +add_custom_target( + psa_constant_names_generated + COMMAND ${PYTHON_EXECUTABLE} scripts/generate_psa_constants.py + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../ +) +add_dependencies(psa_constant_names psa_constant_names_generated) + install(TARGETS crypto_examples key_ladder_demo