summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeFortranCompilerId.F.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-04-27 16:27:29 (GMT)
committerBrad King <brad.king@kitware.com>2021-04-28 14:20:59 (GMT)
commitb7193ab18f74a3b6eb6c24bac31384863ee87ffc (patch)
treecf03dc21f44de751ad54392016f6cdb80a50bc9a /Modules/CMakeFortranCompilerId.F.in
parent21c40086ee59bb44a286d1820089fbc7787d014a (diff)
downloadCMake-b7193ab18f74a3b6eb6c24bac31384863ee87ffc.zip
CMake-b7193ab18f74a3b6eb6c24bac31384863ee87ffc.tar.gz
CMake-b7193ab18f74a3b6eb6c24bac31384863ee87ffc.tar.bz2
Intel: Update Classic compiler version detection for 2021
The value of the `__INTEL_COMPILER` macro changed convention starting in version 2021. Fixes: #22120
Diffstat (limited to 'Modules/CMakeFortranCompilerId.F.in')
-rw-r--r--Modules/CMakeFortranCompilerId.F.in19
1 files changed, 14 insertions, 5 deletions
diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index 0f547e9..143511b 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -38,12 +38,21 @@
# endif
#elif defined(__INTEL_COMPILER) || defined(__ICC)
PRINT *, 'INFO:compiler[Intel]'
-# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
-# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
-# if defined(__INTEL_COMPILER_UPDATE)
-# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
+! __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later.
+# if __INTEL_COMPILER < 2021
+# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
+# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
+# if defined(__INTEL_COMPILER_UPDATE)
+# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
+# else
+# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
+# endif
# else
-# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
+# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER)
+# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE)
+! The third version component from --version is an update index,
+! but no macro is provided for it.
+# define COMPILER_VERSION_PATCH DEC(0)
# endif
# if defined(__INTEL_COMPILER_BUILD_DATE)
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)