summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorStefan Andersson <tfosm@hotmail.com>2017-09-19 14:55:25 (GMT)
committerBrad King <brad.king@kitware.com>2017-10-03 12:11:27 (GMT)
commit1bdb8cd24782173e22946643eb3bbfed2e6b9dc8 (patch)
tree861e1b06744c1b8be1694157ed80716f97179cd8 /Modules
parentb96ca728f1da01c051ac3b44f32b5221d1efeff9 (diff)
downloadCMake-1bdb8cd24782173e22946643eb3bbfed2e6b9dc8.zip
CMake-1bdb8cd24782173e22946643eb3bbfed2e6b9dc8.tar.gz
CMake-1bdb8cd24782173e22946643eb3bbfed2e6b9dc8.tar.bz2
IAR: Detect compiler platform version
`__IAR_SYSTEMS_ICC__` provides additional version information that we need to determine correct usage of the compiler. Extract and store it as `CMAKE_<LANG>_COMPILER_VERSION_INTERNAL`. Issue: #17264
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Compiler/IAR-DetermineCompiler.cmake7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/Compiler/IAR-DetermineCompiler.cmake b/Modules/Compiler/IAR-DetermineCompiler.cmake
index 4ef587b..a1bffeb 100644
--- a/Modules/Compiler/IAR-DetermineCompiler.cmake
+++ b/Modules/Compiler/IAR-DetermineCompiler.cmake
@@ -2,8 +2,10 @@
# http://www.iar.com
# http://supp.iar.com/FilesPublic/UPDINFO/004916/arm/doc/EWARM_DevelopmentGuide.ENU.pdf
#
-# __IAR_SYSTEMS_ICC__ An integer that identifies the IAR compiler platform. The current value is 8. Note that
-# the number could be higher in a future version of the product
+# __IAR_SYSTEMS_ICC__ An integer that identifies the IAR compiler platform:
+# 9 and higher means C11 and C++14 as language default
+# 8 means C99 and C++03 as language default
+# 7 and lower means C89 and EC++ as language default.
# __ICCARM__ An integer that is set to 1 when the code is compiled with the IAR C/C++ Compiler for ARM
# __VER__ An integer that identifies the version number of the IAR compiler in use. For example,
# version 5.11.3 is returned as 5011003.
@@ -15,4 +17,5 @@ set(_compiler_id_version_compute "
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@((__VER__) / 1000000)
# 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__)
# endif")