cmake: Move platform specific parts to platform dir
Rename Config*.cmake files to reflect the target they build for.
Add target specific configuration options to CMake files, and set the
proper values in the Config*.cmake files.
Eliminate direct inclusion of cmsis core_cm33.h
Update build instructions
Change-Id: I7f506b45e649ce3a0d31cc5784c6a01e1710935c
Signed-off-by: Mate Toth-Pal <mate.toth-pal@arm.com>
diff --git a/CommonConfig.cmake b/CommonConfig.cmake
index 1040b3c..f479815 100644
--- a/CommonConfig.cmake
+++ b/CommonConfig.cmake
@@ -13,6 +13,31 @@
message(FATAL_ERROR "ERROR: Incomplete Configuration: BL2 not defined, Include this file from a Config*.cmake")
endif()
+set(BUILD_CMSIS_CORE Off)
+set(BUILD_RETARGET Off)
+set(BUILD_NATIVE_DRIVERS Off)
+set(BUILD_TIME Off)
+set(BUILD_STARTUP Off)
+set(BUILD_TARGET_CFG Off)
+set(BUILD_TARGET_HARDWARE_KEYS Off)
+set(BUILD_CMSIS_DRIVERS Off)
+set(BUILD_UART_STDOUT Off)
+set(BUILD_FLASH Off)
+if(NOT DEFINED PLATFORM_CMAKE_FILE)
+ message (FATAL_ERROR "Platform specific CMake is not defined. Please set PLATFORM_CMAKE_FILE.")
+elseif(NOT EXISTS ${PLATFORM_CMAKE_FILE})
+ message (FATAL_ERROR "Platform specific CMake \"${PLATFORM_CMAKE_FILE}\" file does not exist. Please fix value of PLATFORM_CMAKE_FILE.")
+else()
+ include(${PLATFORM_CMAKE_FILE})
+endif()
+
+
+#Use any ARMCLANG version found on PATH. Note: Only versions supported by the
+#build system will work. A file cmake/Common/CompilerArmClangXY.cmake
+#must be present with a matching version.
+include("Common/FindArmClang")
+include("Common/${ARMCLANG_MODULE}")
+
##Shared compiler and linker settings.
function(config_setting_shared_flags tgt)
embedded_set_target_compile_flags(TARGET ${tgt} LANGUAGE C FLAGS -xc -std=c99 -fshort-enums -mfpu=none -fshort-wchar -funsigned-char -mcmse -Wall -Werror)
@@ -83,11 +108,9 @@
##Secure side
config_setting_shared_flags(tfm_s)
-embedded_set_target_linker_file(TARGET tfm_s PATH "${CMAKE_CURRENT_LIST_DIR}/platform/ext/target/mps2/an521/armclang/mps2_an521_s.sct")
##Non secure side
config_setting_shared_flags(tfm_ns)
-embedded_set_target_linker_file(TARGET tfm_ns PATH "${CMAKE_CURRENT_LIST_DIR}/platform/ext/target/mps2/an521/armclang/mps2_an521_ns.sct")
##TF-M storage
config_setting_shared_flags(tfm_storage)