summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/IAR-CXX.cmake
diff options
context:
space:
mode:
authorStefan Andersson <tfosm@hotmail.com>2019-05-06 09:25:34 (GMT)
committerBrad King <brad.king@kitware.com>2019-05-08 16:55:18 (GMT)
commit41780964936b03754a6551c65d4fd938521130b5 (patch)
tree29a82d47cab8c8f9d203eba9de30ac4c34c2d394 /Modules/Compiler/IAR-CXX.cmake
parent0f27e7d165c96f2c3ada1695df4f6cfaa44afe51 (diff)
downloadCMake-41780964936b03754a6551c65d4fd938521130b5.zip
CMake-41780964936b03754a6551c65d4fd938521130b5.tar.gz
CMake-41780964936b03754a6551c65d4fd938521130b5.tar.bz2
IAR: Add architecture support for RL78, RH850 and MSP430
Diffstat (limited to 'Modules/Compiler/IAR-CXX.cmake')
-rw-r--r--Modules/Compiler/IAR-CXX.cmake34
1 files changed, 19 insertions, 15 deletions
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." )