From 11384b16692bd7e76c93941bac100dbcccc1f9a6 Mon Sep 17 00:00:00 2001 From: Jamie Smith Date: Wed, 10 Sep 2025 09:37:15 -0700 Subject: [PATCH] Fix cysecuretools always being installed --- .../scripts/mbed_set_post_build_cypress.cmake | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake b/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake index 69c24b1ef8e..a72cbab5a2f 100644 --- a/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake +++ b/targets/TARGET_Cypress/scripts/mbed_set_post_build_cypress.cmake @@ -3,12 +3,6 @@ include(mbed_target_functions) -# Make sure we have the python packages we need -mbed_check_or_install_python_package(HAVE_PYTHON_CYSECURETOOLS cysecuretools "cysecuretools~=6.0") -if(NOT HAVE_PYTHON_CYSECURETOOLS) - message(FATAL_ERROR "Python package required for signing not found.") -endif() - # # Merge Cortex-M4 HEX and a Cortex-M0 HEX. # @@ -68,6 +62,13 @@ macro(mbed_post_build_psoc6_sign_image cortex_m0_hex ) if("${cypress_psoc6_target}" STREQUAL "${MBED_TARGET}") + + # Make sure we have the python packages we need + mbed_check_or_install_python_package(HAVE_PYTHON_CYSECURETOOLS cysecuretools "cysecuretools~=6.0") + if(NOT HAVE_PYTHON_CYSECURETOOLS) + message(FATAL_ERROR "Python package required for signing not found.") + endif() + function(mbed_post_build_function target) set(post_build_command ${Python3_EXECUTABLE} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/PSOC6.py