aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorØyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>2021-01-22 14:21:25 +0100
committerDavid Hu <david.hu@arm.com>2021-01-30 02:18:33 +0000
commita9d5eacdb045a5d793aca0e591ec3abe48fa7205 (patch)
tree6964652ff0c4bc2492a6e9e80e611c85d9a6fe5f /CMakeLists.txt
parentc3ba21ef232c2bf0761dfd894e30a3e791b17a0e (diff)
downloadtrusted-firmware-m-a9d5eacdb045a5d793aca0e591ec3abe48fa7205.tar.gz
Build: Support passing absolute paths to TFM_PLATFORM
For convenience when using out-of-tree platforms. Change-Id: I6783eabe9e13c0bdc2412cebd1ff25277cd5dda0 Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 735586ccf5..fc9605ea25 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,13 @@ set(TFM_VERSION 1.2.0)
############################ CONFIGURATION #####################################
+if (IS_ABSOLUTE "${TFM_PLATFORM}")
+ file(RELATIVE_PATH TFM_PLATFORM_RELATIVE_PATH
+ "${CMAKE_CURRENT_SOURCE_DIR}/platform/ext/target"
+ ${TFM_PLATFORM})
+ set(TFM_PLATFORM "${TFM_PLATFORM_RELATIVE_PATH}" CACHE STRING "Target platform set as an absolute path." FORCE)
+endif()
+
# Some compiler flags depend on the CPU / platform config. This include should
# be run before the toolchain file so the compiler can be configured properly.
if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/preload.cmake)