summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-04-29 13:15:24 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-04-29 13:15:32 (GMT)
commit3147f541f7bb411f715e5aa953c4b8913d9fbcd6 (patch)
tree94816fa81d831059d96403e56860fa14dda8c706 /Modules/Compiler
parent60288129db444cf0fee4112e87b30e3ad2a0e007 (diff)
parent9c479c7c40c64d0fbe41cba1b422303989c306f7 (diff)
downloadCMake-3147f541f7bb411f715e5aa953c4b8913d9fbcd6.zip
CMake-3147f541f7bb411f715e5aa953c4b8913d9fbcd6.tar.gz
CMake-3147f541f7bb411f715e5aa953c4b8913d9fbcd6.tar.bz2
Merge topic 'intel-2021'
9c479c7c40 IntelLLVM: Add special case for ifx 2021.1 version extraction b7193ab18f Intel: Update Classic compiler version detection for 2021 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6052
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/Intel-DetermineCompiler.cmake23
1 files changed, 16 insertions, 7 deletions
diff --git a/Modules/Compiler/Intel-DetermineCompiler.cmake b/Modules/Compiler/Intel-DetermineCompiler.cmake
index c31aa77..3c1fde2 100644
--- a/Modules/Compiler/Intel-DetermineCompiler.cmake
+++ b/Modules/Compiler/Intel-DetermineCompiler.cmake
@@ -2,16 +2,25 @@
set(_compiler_id_pp_test "defined(__INTEL_COMPILER) || defined(__ICC)")
set(_compiler_id_version_compute "
- /* __INTEL_COMPILER = VRP */
-# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__INTEL_COMPILER/100)
-# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__INTEL_COMPILER/10 % 10)
-# if defined(__INTEL_COMPILER_UPDATE)
-# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__INTEL_COMPILER_UPDATE)
+ /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later,
+ except that a few beta releases use the old format with V=2021. */
+# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__INTEL_COMPILER/100)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__INTEL_COMPILER/10 % 10)
+# if defined(__INTEL_COMPILER_UPDATE)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__INTEL_COMPILER_UPDATE)
+# else
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__INTEL_COMPILER % 10)
+# endif
# else
-# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__INTEL_COMPILER % 10)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__INTEL_COMPILER)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__INTEL_COMPILER_UPDATE)
+ /* The third version component from --version is an update index,
+ but no macro is provided for it. */
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(0)
# endif
# if defined(__INTEL_COMPILER_BUILD_DATE)
- /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
+ /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
# define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(__INTEL_COMPILER_BUILD_DATE)
# endif
# if defined(_MSC_VER)