aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorTamas Ban <tamas.ban@arm.com>2020-10-27 08:13:18 +0000
committerSoby Mathew <soby.mathew@arm.com>2020-11-03 10:26:38 +0000
commit69219209c06a8a9cf707744b57e2b3e5eb98a29b (patch)
treecfe9f70b792388e3604021666cab1118a507beed /CMakeLists.txt
parent958aeef5c0818c591c043a22defa8882731c9907 (diff)
downloadtrusted-firmware-m-69219209c06a8a9cf707744b57e2b3e5eb98a29b.tar.gz
Build: Adjust configuration order
Reorder the configuration steps, to provide more intuitive configuration. Invert the current order, and remove the use of FORCE to create a configuration additively instead of using overriding. Allows cmake command-line variables to override all other options as is expected. Change-Id: I64730b7db230cdaf2f86f1d27d882dc9111607be Signed-off-by: Tamas Ban <tamas.ban@arm.com> Signed-off-by: Raef Coles <raef.coles@arm.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 8 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 71a24974d..75986f7b0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,14 @@ set(TFM_VERSION 1.1.0)
############################ CONFIGURATION #####################################
+# 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)
+ Message(FATAL_ERROR "Unsupported TFM_PLATFORM ${TFM_PLATFORM}")
+else()
+ include(platform/ext/target/${TFM_PLATFORM}/preload.cmake)
+endif()
+
include(config/set_config.cmake)
if(NOT ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" AND
@@ -28,14 +36,6 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
############################### Compiler configuration #########################
-# 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)
- Message(FATAL_ERROR "Unsupported TFM_PLATFORM ${TFM_PLATFORM}")
-else()
- include(platform/ext/target/${TFM_PLATFORM}/preload.cmake)
-endif()
-
#Legacy compat option - load CMAKE_TOOLCHAIN_FILE as a TFM_TOOLCHAIN_FILE
if (CMAKE_TOOLCHAIN_FILE)
message(DEPRECATION "SETTING CMAKE_TOOLCHAIN_FILE is deprecated. It has been replaced with TFM_TOOLCHAIN_FILE.")