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>
diff --git a/cmake/Common/CompilerGNUARM73.cmake b/cmake/Common/CompilerGNUARM73.cmake
index 29b9555..5b173e0 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_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()