diff options
author | David Truby <david.truby@gmail.com> | 2023-02-14 13:55:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-02-14 14:22:12 (GMT) |
commit | 3f1e58c5b988036563ccf3d5efed3161038206d5 (patch) | |
tree | 65411c60b69e4611d1473a9027f51c40dfc202d2 /Modules/Compiler/LLVMFlang-Fortran.cmake | |
parent | d18dd364d36fc4554c04d1c11e903817b0f5c73f (diff) | |
download | CMake-3f1e58c5b988036563ccf3d5efed3161038206d5.zip CMake-3f1e58c5b988036563ccf3d5efed3161038206d5.tar.gz CMake-3f1e58c5b988036563ccf3d5efed3161038206d5.tar.bz2 |
LLVMFlang: Fix post-preprocess compile for fixed-form Fortran
LLVM Flang's preprocessor output is always valid fixed form Fortran with
a fixed line length of 72. If an application tries to use fixed form
with a different line length, this will fail in the
post-preprocessing compilation step as they will pass a flag asking for
a different fixed line length.
To fix this we can pass -ffixed-line-length-72 to the post-preprocess
compilation stage. This will be ignored when the input is free form
Fortran, and force to a 72 line length when the input is fixed.
Diffstat (limited to 'Modules/Compiler/LLVMFlang-Fortran.cmake')
-rw-r--r-- | Modules/Compiler/LLVMFlang-Fortran.cmake | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/Compiler/LLVMFlang-Fortran.cmake b/Modules/Compiler/LLVMFlang-Fortran.cmake index 651bf51..9e72b06 100644 --- a/Modules/Compiler/LLVMFlang-Fortran.cmake +++ b/Modules/Compiler/LLVMFlang-Fortran.cmake @@ -13,3 +13,4 @@ set(CMAKE_Fortran_MODDIR_FLAG "-module-dir") set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-cpp") set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-nocpp") +set(CMAKE_Fortran_POSTPROCESS_FLAG "-ffixed-line-length-72") |