mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 12:49:36 -06:00
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.
17 lines
580 B
CMake
17 lines
580 B
CMake
set(CMAKE_Fortran_VERBOSE_FLAG "-v")
|
|
|
|
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")
|
|
set(CMAKE_Fortran_POSTPROCESS_FLAG "-ffixed-line-length-72")
|