CMake platform: remove MBED_PATH, use standard variables

As we still use target labels, TFM is not visible to CMake. Protect include of their scripts with the same mechanism.
pull/14516/head
Martin Kojtal 2021-04-08 13:36:27 +01:00
parent dfc4010e24
commit afd938491a
4 changed files with 24 additions and 18 deletions

View File

@ -39,3 +39,5 @@ target_sources(mbed-psa
src/tfm_platform_ipc_api.c
src/tfm_ps_ipc_api.c
)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/scripts")

View File

@ -1,7 +1,7 @@
# Copyright (c) 2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
include(${MBED_PATH}/tools/cmake/mbed_set_post_build.cmake)
include(mbed_set_post_build)
#
# Sign TF-M secure and non-secure images and combine them with the bootloader
@ -17,7 +17,7 @@ function(mbed_post_build_tfm_sign_image
set(mbed_target_name ${mbed_target})
set(post_build_command
COMMAND ${Python3_EXECUTABLE}
${MBED_PATH}/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/scripts/generate_mbed_image.py
${CMAKE_CURRENT_LIST_DIR}/scripts/generate_mbed_image.py
--tfm-target ${tfm_target}
--target-path ${target_path}
--secure-bin ${secure_bin}

View File

@ -1,7 +1,16 @@
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
include(${mbed-os_SOURCE_DIR}/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/scripts/mbed_set_post_build_tfm.cmake)
if("TFM" IN_LIST MBED_TARGET_LABELS)
include(mbed_set_post_build_tfm)
mbed_post_build_tfm_sign_image(
ARM_MUSCA_B1
musca_b1
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/tfm_s.bin
)
endif()
add_library(mbed-arm-musca-b1 INTERFACE)
@ -54,10 +63,3 @@ target_link_libraries(mbed-arm-musca-b1
${CMAKE_CURRENT_SOURCE_DIR}/s_veneers.o
mbed-arm-ssg
)
mbed_post_build_tfm_sign_image(
ARM_MUSCA_B1
musca_b1
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/tfm_s.bin
)

View File

@ -1,7 +1,16 @@
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
include(${mbed-os_SOURCE_DIR}/platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA/TARGET_TFM/TARGET_TFM_LATEST/scripts/mbed_set_post_build_tfm.cmake)
if("TFM" IN_LIST MBED_TARGET_LABELS)
include(mbed_set_post_build_tfm)
mbed_post_build_tfm_sign_image(
ARM_MUSCA_S1
musca_s1
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/tfm_s.bin
)
endif()
add_library(mbed-arm-musca-s1 INTERFACE)
@ -60,10 +69,3 @@ target_link_libraries(mbed-arm-musca-s1
${CMAKE_CURRENT_SOURCE_DIR}/s_veneers.o
mbed-arm-ssg
)
mbed_post_build_tfm_sign_image(
ARM_MUSCA_S1
musca_s1
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/tfm_s.bin
)