summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-05-13 14:03:25 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-05-13 14:03:35 (GMT)
commit2bc9ddcad9f9a01055e5e3acc02a501b31af9940 (patch)
tree7c6662984280f7efd2ad690035489f453f05e6a1 /Modules
parentb498967243cb531c8c6fe60e6712432a2064507b (diff)
parent41780964936b03754a6551c65d4fd938521130b5 (diff)
downloadCMake-2bc9ddcad9f9a01055e5e3acc02a501b31af9940.zip
CMake-2bc9ddcad9f9a01055e5e3acc02a501b31af9940.tar.gz
CMake-2bc9ddcad9f9a01055e5e3acc02a501b31af9940.tar.bz2
Merge topic 'iar-new_architectures'
4178096493 IAR: Add architecture support for RL78, RH850 and MSP430 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3288
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakePlatformId.h.in9
-rw-r--r--Modules/Compiler/IAR-ASM.cmake15
-rw-r--r--Modules/Compiler/IAR-C.cmake21
-rw-r--r--Modules/Compiler/IAR-CXX.cmake34
-rw-r--r--Modules/Compiler/IAR-DetermineCompiler.cmake2
-rw-r--r--Modules/Compiler/IAR-FindBinUtils.cmake9
6 files changed, 62 insertions, 28 deletions
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index c88094a..8f5747a 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -159,9 +159,18 @@
# elif defined(__ICCRX__)
# define ARCHITECTURE_ID "RX"
+# elif defined(__ICCRH850__)
+# define ARCHITECTURE_ID "RH850"
+
+# elif defined(__ICCRL78__)
+# define ARCHITECTURE_ID "RL78"
+
# elif defined(__ICCAVR__)
# define ARCHITECTURE_ID "AVR"
+# elif defined(__ICC430__)
+# define ARCHITECTURE_ID "MSP430"
+
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
diff --git a/Modules/Compiler/IAR-ASM.cmake b/Modules/Compiler/IAR-ASM.cmake
index f9c0ced..71f2ac6 100644
--- a/Modules/Compiler/IAR-ASM.cmake
+++ b/Modules/Compiler/IAR-ASM.cmake
@@ -12,11 +12,26 @@ elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RX")
__compiler_iar_ilink(ASM)
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;asm;msa)
+elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RH850")
+ set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> --silent <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
+ __compiler_iar_ilink(ASM)
+ set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;asm;msa)
+
+elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RL78")
+ set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> --silent <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
+ __compiler_iar_ilink(ASM)
+ set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;asm;msa)
+
elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -S <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
__compiler_iar_xlink(ASM)
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s90;asm;msa)
+elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "MSP430")
+ set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -S <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
+ __compiler_iar_xlink(ASM)
+ set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s43;asm;msa)
+
else()
message(FATAL_ERROR "CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID not detected. This should be automatic.")
endif()
diff --git a/Modules/Compiler/IAR-C.cmake b/Modules/Compiler/IAR-C.cmake
index af5874c..4b02a9a 100644
--- a/Modules/Compiler/IAR-C.cmake
+++ b/Modules/Compiler/IAR-C.cmake
@@ -38,20 +38,23 @@ elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "RX")
__compiler_iar_ilink(C)
__compiler_check_default_language_standard(C 1.10 90 2.10 99 4.10 11)
+elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "RH850")
+ __compiler_iar_ilink(C)
+ __compiler_check_default_language_standard(C 1.10 90 1.10 99 2.10 11)
+
+elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "RL78")
+ __compiler_iar_ilink(C)
+ __compiler_check_default_language_standard(C 1.10 90 1.10 99 4.10 11)
+
elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
__compiler_iar_xlink(C)
__compiler_check_default_language_standard(C 7.10 99)
set(CMAKE_C_OUTPUT_EXTENSION ".r90")
- if(NOT CMAKE_C_LINK_FLAGS)
- set(CMAKE_C_LINK_FLAGS "-Fmotorola")
- endif()
-
- # add the target specific include directory:
- get_filename_component(_compilerDir "${CMAKE_C_COMPILER}" PATH)
- get_filename_component(_compilerDir "${_compilerDir}" PATH)
- include_directories("${_compilerDir}/inc" )
- include_directories("${_compilerDir}/inc/Atmel" )
+elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "MSP430")
+ __compiler_iar_xlink(C)
+ __compiler_check_default_language_standard(C 1.10 90 5.10 99)
+ set(CMAKE_C_OUTPUT_EXTENSION ".r43")
else()
message(FATAL_ERROR "CMAKE_C_COMPILER_ARCHITECTURE_ID not detected. This should be automatic.")
diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake
index 04ccbe5..22ec118 100644
--- a/Modules/Compiler/IAR-CXX.cmake
+++ b/Modules/Compiler/IAR-CXX.cmake
@@ -4,12 +4,14 @@ include(Compiler/IAR)
include(Compiler/CMakeCommonCompilerMacros)
# Common
-if(NOT CMAKE_IAR_CXX_FLAG)
- if(NOT CMAKE_CXX_COMPILER_VERSION)
- message(FATAL_ERROR "CMAKE_CXX_COMPILER_VERSION not detected. This should be automatic.")
- endif()
+if(NOT CMAKE_CXX_COMPILER_VERSION)
+ message(FATAL_ERROR "CMAKE_CXX_COMPILER_VERSION not detected. This should be automatic.")
+endif()
- if(CMAKE_CXX_COMPILER_VERSION_INTERNAL VERSION_GREATER 7)
+if(NOT CMAKE_IAR_CXX_FLAG)
+ # The --c++ flag was introduced in platform version 9 for all architectures except ARM where it was introduced already in version 7
+ if(CMAKE_CXX_COMPILER_VERSION_INTERNAL VERSION_GREATER 8 OR
+ (CMAKE_CXX_COMPILER_VERSION_INTERNAL VERSION_GREATER 6 AND "${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM") )
set(CMAKE_IAR_CXX_FLAG --c++)
else()
set(CMAKE_IAR_CXX_FLAG --eec++)
@@ -45,20 +47,22 @@ elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "RX")
__compiler_iar_ilink(CXX)
__compiler_check_default_language_standard(CXX 2.10 98 4.10 14)
+elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "RH850")
+ __compiler_iar_ilink(CXX)
+ __compiler_check_default_language_standard(CXX 1.10 98 2.10 14)
+
+elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "RL78")
+ __compiler_iar_ilink(CXX)
+ __compiler_check_default_language_standard(CXX 1.10 98 4.10 14)
+
elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
__compiler_iar_xlink(CXX)
__compiler_check_default_language_standard(CXX 7.10 98)
- set(CMAKE_CXX_OUTPUT_EXTENSION ".r90")
- if(NOT CMAKE_CXX_LINK_FLAGS)
- set(CMAKE_CXX_LINK_FLAGS "-Fmotorola")
- endif()
-
- # add the target specific include directory:
- get_filename_component(_compilerDir "${CMAKE_C_COMPILER}" PATH)
- get_filename_component(_compilerDir "${_compilerDir}" PATH)
- include_directories("${_compilerDir}/inc" )
- include_directories("${_compilerDir}/inc/Atmel" )
+elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "MSP430")
+ __compiler_iar_xlink(CXX)
+ __compiler_check_default_language_standard(CXX 5.10 98)
+ set(CMAKE_CXX_OUTPUT_EXTENSION ".r43")
else()
message(FATAL_ERROR "CMAKE_CXX_COMPILER_ARCHITECTURE_ID not detected. This should be automatic." )
diff --git a/Modules/Compiler/IAR-DetermineCompiler.cmake b/Modules/Compiler/IAR-DetermineCompiler.cmake
index cdfb095..6b09c40 100644
--- a/Modules/Compiler/IAR-DetermineCompiler.cmake
+++ b/Modules/Compiler/IAR-DetermineCompiler.cmake
@@ -31,7 +31,7 @@ set(_compiler_id_version_compute "
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(((__VER__) / 1000) % 1000)
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@((__VER__) % 1000)
# define @PREFIX@COMPILER_VERSION_INTERNAL @MACRO_DEC@(__IAR_SYSTEMS_ICC__)
-# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__))
+# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__))
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@((__VER__) / 100)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@((__VER__) - (((__VER__) / 100)*100))
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__SUBVERSION__)
diff --git a/Modules/Compiler/IAR-FindBinUtils.cmake b/Modules/Compiler/IAR-FindBinUtils.cmake
index 7fc6b59..3f13dce 100644
--- a/Modules/Compiler/IAR-FindBinUtils.cmake
+++ b/Modules/Compiler/IAR-FindBinUtils.cmake
@@ -11,7 +11,9 @@ get_filename_component(__iar_hint_2 "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPI
set(__iar_hints "${__iar_hint_1}" "${__iar_hint_2}")
if("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM" OR
- "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RX")
+ "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RX" OR
+ "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RH850" OR
+ "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RL78")
string(TOLOWER "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" _archid_lower)
@@ -41,9 +43,10 @@ set(CMAKE_IAR_OBJMANIP \"${CMAKE_IAR_OBJMANIP}\")
set(CMAKE_IAR_LINKER \"${CMAKE_IAR_LINKER}\")
")
-elseif("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
+elseif("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR" OR
+ "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "MSP430")
- # For AVR and AVR32, IAR uses the "xlink" linker and the "xar" archiver:
+ # Find the "xlink" linker and "xar" archiver:
find_program(CMAKE_IAR_LINKER xlink HINTS ${__iar_hints}
DOC "The IAR XLINK linker")
find_program(CMAKE_IAR_AR xar HINTS ${__iar_hints}