aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSverteczky, Marcell <marcell.sverteczky@arm.com>2019-06-03 14:13:36 +0200
committerGyörgy Szing <gyorgy.szing@arm.com>2019-06-11 08:13:36 +0000
commitd3321196e2ac32553e03221d1a63c2d8ecc4c209 (patch)
treec4c7528d52ca3078a0f0bbbce943dd0d3dc34b38
parente7efdc6e8d89a22c4cac5b6ccc8e7d0d332ff034 (diff)
downloadtrusted-firmware-m-d3321196e2ac32553e03221d1a63c2d8ecc4c209.tar.gz
Build: Fix compiler related cmake variables
This change fixes some compiler related variables in the cmake files. Change-Id: Icd1059aa6b4dc7c7a617fcd6ceb3a0216854e349 Signed-off-by: Sverteczky, Marcell <marcell.sverteczky@arm.com>
-rw-r--r--cmake/Common/CompilerArmClang610.cmake34
-rw-r--r--cmake/Common/CompilerArmClang611.cmake34
-rw-r--r--cmake/Common/CompilerArmClang67.cmake36
-rw-r--r--cmake/Common/CompilerArmClang69.cmake36
-rw-r--r--cmake/Common/CompilerGNUARM63.cmake26
-rw-r--r--cmake/Common/CompilerGNUARM73.cmake26
6 files changed, 110 insertions, 82 deletions
diff --git a/cmake/Common/CompilerArmClang610.cmake b/cmake/Common/CompilerArmClang610.cmake
index d9fc30edf2..2570a01459 100644
--- a/cmake/Common/CompilerArmClang610.cmake
+++ b/cmake/Common/CompilerArmClang610.cmake
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2018, Arm Limited. All rights reserved.
+# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -31,7 +31,7 @@ elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.MAIN")
string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Main")
elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv7-M")
string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
- string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=7-M")
@@ -45,20 +45,26 @@ if(NOT DEFINED ARM_CPU_ARCHITECTURE)
if(NOT DEFINED ARM_CPU_TYPE)
string_append_unique_item(_NO_ARM_CPU_TYPE true)
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M3")
- string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m3")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m3")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M3")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M3")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m3")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m3")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M3")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M3")
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M33")
- string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m33")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m33")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M33")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M33")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m33")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m33")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M33")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M33")
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M23")
- string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m23")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m23")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M23")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M23")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m23")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m23")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M23")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M23")
else()
message(FATAL_ERROR "Unknown ARM cpu setting.")
endif()
diff --git a/cmake/Common/CompilerArmClang611.cmake b/cmake/Common/CompilerArmClang611.cmake
index 05368cb20b..9e0f066b68 100644
--- a/cmake/Common/CompilerArmClang611.cmake
+++ b/cmake/Common/CompilerArmClang611.cmake
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2018, Arm Limited. All rights reserved.
+# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -31,7 +31,7 @@ elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.MAIN")
string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Main")
elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv7-M")
string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
- string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=7-M")
@@ -45,20 +45,26 @@ if(NOT DEFINED ARM_CPU_ARCHITECTURE)
if(NOT DEFINED ARM_CPU_TYPE)
string_append_unique_item(_NO_ARM_CPU_TYPE true)
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M3")
- string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m3")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m3")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M3")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M3")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m3")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m3")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M3")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M3")
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M33")
- string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m33")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m33")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M33")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M33")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m33")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m33")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M33")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M33")
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M23")
- string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m23")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m23")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M23")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M23")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m23")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m23")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M23")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M23")
else()
message(FATAL_ERROR "Unknown ARM cpu setting.")
endif()
diff --git a/cmake/Common/CompilerArmClang67.cmake b/cmake/Common/CompilerArmClang67.cmake
index 44b0029d73..b563c4d3ee 100644
--- a/cmake/Common/CompilerArmClang67.cmake
+++ b/cmake/Common/CompilerArmClang67.cmake
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2017-2018, Arm Limited. All rights reserved.
+# Copyright (c) 2017-2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -33,7 +33,7 @@ elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.MAIN")
string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Main")
elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv7-M")
string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
- string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=7-M")
@@ -47,22 +47,30 @@ if(NOT DEFINED ARM_CPU_ARCHITECTURE)
if(NOT DEFINED ARM_CPU_TYPE)
string_append_unique_item(_NO_ARM_CPU_TYPE true)
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M3")
- string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m3")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m3")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M3")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M3")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m3")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m3")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M3")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M3")
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M33")
- string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m33")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m33")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M33")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M33")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m33")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m33")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M33")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M33")
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M23")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m23")
#-fno-optimize-sibling-calls is here to work around an armclang compiler
#bug that is fixed in 6.10
- string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m23 -fno-optimize-sibling-calls")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m23 -fno-optimize-sibling-calls")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M23")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M23")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-fno-optimize-sibling-calls" VAL "-fno-optimize-sibling-calls")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m23")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-fno-optimize-sibling-calls" VAL "-fno-optimize-sibling-calls")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M23")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M23")
else()
message(FATAL_ERROR "Unknown ARM cpu setting.")
endif()
diff --git a/cmake/Common/CompilerArmClang69.cmake b/cmake/Common/CompilerArmClang69.cmake
index de35f329e5..ab1d1fcb45 100644
--- a/cmake/Common/CompilerArmClang69.cmake
+++ b/cmake/Common/CompilerArmClang69.cmake
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2017-2018, Arm Limited. All rights reserved.
+# Copyright (c) 2017-2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -33,7 +33,7 @@ elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv8-M.MAIN")
string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=8-M.Main")
elseif(${ARM_CPU_ARCHITECTURE} STREQUAL "ARMv7-M")
string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
- string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv8-m")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-march=" VAL "-march=armv7-m")
string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=7-M")
@@ -47,22 +47,30 @@ if(NOT DEFINED ARM_CPU_ARCHITECTURE)
if(NOT DEFINED ARM_CPU_TYPE)
string_append_unique_item(_NO_ARM_CPU_TYPE true)
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M3")
- string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m3")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m3")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M3")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M3")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m3")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m3")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M3")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M3")
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M33")
- string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m33")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m33")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M33")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M33")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m33")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m33")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M33")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M33")
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M23")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m23")
#-fno-optimize-sibling-calls is here to work around an armclang compiler
#bug that is fixed in 6.10
- string_append_unique_item (CMAKE_C_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m23 -fno-optimize-sibling-calls")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "--target=arm-arm-none-eabi -mcpu=cortex-m23 -fno-optimize-sibling-calls")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M23")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M23")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-fno-optimize-sibling-calls" VAL "-fno-optimize-sibling-calls")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "--target=" VAL "--target=arm-arm-none-eabi")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m23")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-fno-optimize-sibling-calls" VAL "-fno-optimize-sibling-calls")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M23")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu" VAL "--cpu=Cortex-M23")
else()
message(FATAL_ERROR "Unknown ARM cpu setting.")
endif()
diff --git a/cmake/Common/CompilerGNUARM63.cmake b/cmake/Common/CompilerGNUARM63.cmake
index fad1264061..a9bdd89f52 100644
--- a/cmake/Common/CompilerGNUARM63.cmake
+++ b/cmake/Common/CompilerGNUARM63.cmake
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2017-2018, Arm Limited. All rights reserved.
+# Copyright (c) 2017-2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -39,20 +39,20 @@ if(NOT DEFINED ARM_CPU_ARCHITECTURE)
if(NOT DEFINED ARM_CPU_TYPE)
string_append_unique_item(_NO_ARM_CPU_TYPE true)
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M3")
- string_append_unique_item (CMAKE_C_FLAGS_CPU "-mcpu=cortex-m3")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "-mcpu=cortex-m3")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M3")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M3")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m3")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m3")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=Cortex-M3")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=Cortex-M3")
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M33")
- string_append_unique_item (CMAKE_C_FLAGS_CPU "-mcpu=cortex-m33")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "-mcpu=cortex-m33")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M33")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M33")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m33")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m33")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=Cortex-M33")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=Cortex-M33")
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M23")
- string_append_unique_item (CMAKE_C_FLAGS_CPU "-mcpu=cortex-m23")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "-mcpu=cortex-m23")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M23")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M23")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m23")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m23")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=Cortex-M23")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=Cortex-M23")
else()
message(FATAL_ERROR "Unknown ARM cpu setting.")
endif()
diff --git a/cmake/Common/CompilerGNUARM73.cmake b/cmake/Common/CompilerGNUARM73.cmake
index 29b9555a66..5b173e05ef 100644
--- a/cmake/Common/CompilerGNUARM73.cmake
+++ b/cmake/Common/CompilerGNUARM73.cmake
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2018, Arm Limited. All rights reserved.
+# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -39,20 +39,20 @@ if(NOT DEFINED ARM_CPU_ARCHITECTURE)
if(NOT DEFINED ARM_CPU_TYPE)
string_append_unique_item(_NO_ARM_CPU_TYPE true)
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M3")
- string_append_unique_item (CMAKE_C_FLAGS_CPU "-mcpu=cortex-m3")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "-mcpu=cortex-m3")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M3")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M3")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m3")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m3")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=Cortex-M3")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=Cortex-M3")
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M33")
- string_append_unique_item (CMAKE_C_FLAGS_CPU "-mcpu=cortex-m33")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "-mcpu=cortex-m33")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M33")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M33")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m33")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m33")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=Cortex-M33")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=Cortex-M33")
elseif(${ARM_CPU_TYPE} STREQUAL "Cortex-M23")
- string_append_unique_item (CMAKE_C_FLAGS_CPU "-mcpu=cortex-m23")
- string_append_unique_item (CMAKE_CXX_FLAGS_CPU "-mcpu=cortex-m23")
- string_append_unique_item (CMAKE_ASM_FLAGS_CPU "--cpu=Cortex-M23")
- string_append_unique_item (CMAKE_LINK_FLAGS_CPU "--cpu=Cortex-M23")
+ string_append_unique_item(STRING CMAKE_C_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m23")
+ string_append_unique_item(STRING CMAKE_CXX_FLAGS_CPU KEY "-mcpu=" VAL "-mcpu=cortex-m23")
+ string_append_unique_item(STRING CMAKE_ASM_FLAGS_CPU KEY "--cpu=" VAL "--cpu=Cortex-M23")
+ string_append_unique_item(STRING CMAKE_LINK_FLAGS_CPU KEY "--cpu=" VAL "--cpu=Cortex-M23")
else()
message(FATAL_ERROR "Unknown ARM cpu setting.")
endif()