mirror of
https://github.com/reactos/CMake.git
synced 2024-12-14 15:19:39 +00:00
39ebfc79e6
All Fortran sources need to be preprocessed before any source may be compiled so that module dependencies can be (later) extracted. Factor out an explicit preprocessing step preceding compilation. Use Ninja depfile dependencies on the preprocessing step and then compile the already-preprocessed source with a separate build statement that depends explicitly only on the preprocessor output. Later we will insert dynamic discovery of module dependencies between these steps.
19 lines
602 B
CMake
19 lines
602 B
CMake
include(Compiler/GNU)
|
|
__compiler_gnu(Fortran)
|
|
|
|
set(CMAKE_Fortran_PREPROCESS_SOURCE
|
|
"<CMAKE_Fortran_COMPILER> -cpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> -o <PREPROCESSED_SOURCE>")
|
|
|
|
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form")
|
|
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form")
|
|
|
|
# No -DNDEBUG for Fortran.
|
|
string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " -Os")
|
|
string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O3")
|
|
|
|
# No -isystem for Fortran because it will not find .mod files.
|
|
unset(CMAKE_INCLUDE_SYSTEM_FLAG_Fortran)
|
|
|
|
# Fortran-specific feature flags.
|
|
set(CMAKE_Fortran_MODDIR_FLAG -J)
|