diff options
author | Tin Huynh <ahuynh@nvidia.com> | 2021-07-08 01:20:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-05-24 14:37:33 (GMT) |
commit | 85749766dff084e433f05b23f9b93c28704ab014 (patch) | |
tree | c85b8209c3a3264969858f88eee06da1c0378b84 /Modules/Compiler | |
parent | f791cd23d408ff7af104d119898c4dd8e1e87688 (diff) | |
download | CMake-85749766dff084e433f05b23f9b93c28704ab014.zip CMake-85749766dff084e433f05b23f9b93c28704ab014.tar.gz CMake-85749766dff084e433f05b23f9b93c28704ab014.tar.bz2 |
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/Compiler')
-rw-r--r-- | Modules/Compiler/LLVMFlang-Fortran.cmake | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Modules/Compiler/LLVMFlang-Fortran.cmake b/Modules/Compiler/LLVMFlang-Fortran.cmake new file mode 100644 index 0000000..7e9ba5e --- /dev/null +++ b/Modules/Compiler/LLVMFlang-Fortran.cmake @@ -0,0 +1,13 @@ +set(CMAKE_Fortran_SUBMODULE_SEP "-") +set(CMAKE_Fortran_SUBMODULE_EXT ".mod") + +set(CMAKE_Fortran_PREPROCESS_SOURCE + "<CMAKE_Fortran_COMPILER> -cpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") + +set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form") +set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form") + +set(CMAKE_Fortran_MODDIR_FLAG "-module-dir") + +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-cpp") +set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-nocpp") |