summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-02-12 11:52:21 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-02-12 11:52:27 (GMT)
commitea11c13259dd371725db9eeffd2b4dce1a6c58a4 (patch)
tree1979ed57efcaa41891d51822ca070a9f8f960e5e
parentfaec25c19899faef39d082b5b0b2e1120c298459 (diff)
parent8ee933900e53646a9d4753211d6828b1dfb21709 (diff)
downloadCMake-ea11c13259dd371725db9eeffd2b4dce1a6c58a4.zip
CMake-ea11c13259dd371725db9eeffd2b4dce1a6c58a4.tar.gz
CMake-ea11c13259dd371725db9eeffd2b4dce1a6c58a4.tar.bz2
Merge topic 'iar-stm8-compiler-support' into release-3.20
8ee933900e IAR: add support for the STM8 compiler Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5796
-rw-r--r--Help/release/3.20.rst2
-rw-r--r--Modules/CMakePlatformId.h.in3
-rw-r--r--Modules/Compiler/IAR-ASM.cmake5
-rw-r--r--Modules/Compiler/IAR-C.cmake4
-rw-r--r--Modules/Compiler/IAR-CXX.cmake4
-rw-r--r--Modules/Compiler/IAR-DetermineCompiler.cmake2
-rw-r--r--Modules/Compiler/IAR-FindBinUtils.cmake3
7 files changed, 21 insertions, 2 deletions
diff --git a/Help/release/3.20.rst b/Help/release/3.20.rst
index 4a3ff70..efe937b 100644
--- a/Help/release/3.20.rst
+++ b/Help/release/3.20.rst
@@ -58,6 +58,8 @@ Compilers
The Intel oneAPI Classic compilers (``icc``, ``icpc``, and ``ifort``)
continue to be supported with compiler id ``Intel``.
+* Support was added for the IAR STM8 compiler.
+
Platforms
---------
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index c0cab71..1dc12c0 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -186,6 +186,9 @@
# elif defined(__ICC8051__)
# define ARCHITECTURE_ID "8051"
+# elif defined(__ICCSTM8__)
+# define ARCHITECTURE_ID "STM8"
+
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
diff --git a/Modules/Compiler/IAR-ASM.cmake b/Modules/Compiler/IAR-ASM.cmake
index 936d4ae..e3ca16e 100644
--- a/Modules/Compiler/IAR-ASM.cmake
+++ b/Modules/Compiler/IAR-ASM.cmake
@@ -47,6 +47,11 @@ elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "8051")
__compiler_iar_xlink(ASM)
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s51;asm;msa)
+elseif("${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARCHITECTURE_ID}" STREQUAL "STM8")
+ 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)
+
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 e27fdfc..054ee74 100644
--- a/Modules/Compiler/IAR-C.cmake
+++ b/Modules/Compiler/IAR-C.cmake
@@ -70,6 +70,10 @@ elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "8051")
__compiler_check_default_language_standard(C 6.10 90 8.10 99)
set(CMAKE_C_OUTPUT_EXTENSION ".r51")
+elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "STM8")
+ __compiler_iar_ilink(C)
+ __compiler_check_default_language_standard(C 3.11 90 3.11 99)
+
else()
message(FATAL_ERROR "CMAKE_C_COMPILER_ARCHITECTURE_ID not detected. This should be automatic.")
endif()
diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake
index eca89c5..d93b272 100644
--- a/Modules/Compiler/IAR-CXX.cmake
+++ b/Modules/Compiler/IAR-CXX.cmake
@@ -78,6 +78,10 @@ elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "8051")
__compiler_check_default_language_standard(CXX 6.10 98)
set(CMAKE_C_OUTPUT_EXTENSION ".r51")
+elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "STM8")
+ __compiler_iar_ilink(CXX)
+ __compiler_check_default_language_standard(CXX 3.11 98)
+
else()
message(FATAL_ERROR "CMAKE_CXX_COMPILER_ARCHITECTURE_ID not detected. This should be automatic." )
endif()
diff --git a/Modules/Compiler/IAR-DetermineCompiler.cmake b/Modules/Compiler/IAR-DetermineCompiler.cmake
index 0a026b2..443b09c 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__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__))
+# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
# 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 6ef3759..6c67d34 100644
--- a/Modules/Compiler/IAR-FindBinUtils.cmake
+++ b/Modules/Compiler/IAR-FindBinUtils.cmake
@@ -14,7 +14,8 @@ if("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "A
"${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" OR
- "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RISCV")
+ "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "RISCV" OR
+ "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "STM8")
string(TOLOWER "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" _archid_lower)