Просмотр исходного кода

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.
David Truby 3 лет назад
Родитель
Сommit
3f1e58c5b9
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      Modules/Compiler/LLVMFlang-Fortran.cmake

+ 1 - 0
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")