summaryrefslogtreecommitdiff
path: root/Modules/CMakeFortranCompilerId.F.in
diff options
context:
space:
mode:
authorTin Huynh <ahuynh@nvidia.com>2021-07-07 18:20:36 -0700
committerBrad King <brad.king@kitware.com>2022-05-24 10:37:33 -0400
commit85749766dff084e433f05b23f9b93c28704ab014 (patch)
treec85b8209c3a3264969858f88eee06da1c0378b84 /Modules/CMakeFortranCompilerId.F.in
parentf791cd23d408ff7af104d119898c4dd8e1e87688 (diff)
downloadcmake-85749766dff084e433f05b23f9b93c28704ab014.tar.gz
LLVMFlang: Add support for LLVM Flang
LLVM Flang (https://github.com/llvm/llvm-project/tree/main/flang) is an LLVM Fortran compiler that shares the same name as Flang (also known as Classic Flang). Classic Flang is in active development and is already identified by CMake as Flang. As such, LLVM Flang will be identified as `LLVMFlang`. Fixes: #22387
Diffstat (limited to 'Modules/CMakeFortranCompilerId.F.in')
-rw-r--r--Modules/CMakeFortranCompilerId.F.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index 969c8414c3..f5c2ab55df 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -154,6 +154,13 @@
# if defined(__FLANG_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__FLANG_PATCHLEVEL__)
# endif
+#elif defined(__flang__)
+ PRINT *, 'INFO:compiler[LLVMFlang]'
+# define COMPILER_VERSION_MAJOR DEC(__flang_major__)
+# define COMPILER_VERSION_MINOR DEC(__flang_minor__)
+# if defined(__flang_patchlevel__)
+# define COMPILER_VERSION_PATCH DEC(__flang_patchlevel__)
+# endif
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
PRINT *, 'INFO:compiler[VisualAge]'
#elif defined(__hpux) || defined(__hpux__)