summaryrefslogtreecommitdiff
path: root/Modules/CMakeFortranCompilerId.F.in
diff options
context:
space:
mode:
authorTin Huynh <ahuynh@nvidia.com>2017-08-04 17:50:09 -0700
committerBrad King <brad.king@kitware.com>2017-08-31 15:24:59 -0400
commit2f3a07a981edfbc325f19ea252003e9da59dbcf5 (patch)
tree6ca31c90c90ddec49fde7009262775dc16078cfa /Modules/CMakeFortranCompilerId.F.in
parent9bad65940c87f594a5f1007019d4b187068dbce0 (diff)
downloadcmake-2f3a07a981edfbc325f19ea252003e9da59dbcf5.tar.gz
Flang: Add support for flang Fortran compiler
flang is a Fortran compiler built on top of clang [1]. Because flang shares a lot of commonalities with clang, the flang module piggybacks off the clang module and overrides certain options. Add flang to Fortran compiler auto find list. Update flang preprocessor macros to differentiate from PGI. Add Flang-FindBinUtils. [1] https://github.com/flang-compiler/flang
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 26b2ed6562..49789f1972 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -90,6 +90,13 @@
# if defined(__PGIC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
+#elif defined(__FLANG)
+ PRINT *, 'INFO:compiler[Flang]'
+# 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(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
PRINT *, 'INFO:compiler[MIPSpro]'
# if 0