GNU-Fortran.cmake 735 Bytes
Newer Older
1 2 3
include(Compiler/GNU)
__compiler_gnu(Fortran)

4 5 6
set(CMAKE_Fortran_SUBMODULE_SEP "@")
set(CMAKE_Fortran_SUBMODULE_EXT ".smod")

7 8 9
set(CMAKE_Fortran_PREPROCESS_SOURCE
  "<CMAKE_Fortran_COMPILER> -cpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> -o <PREPROCESSED_SOURCE>")

10 11 12
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form")

13 14
set(CMAKE_Fortran_POSTPROCESS_FLAG "-fpreprocessed")

15
# No -DNDEBUG for Fortran.
16 17
string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " -Os")
string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O3")
18

19 20 21
# No -isystem for Fortran because it will not find .mod files.
unset(CMAKE_INCLUDE_SYSTEM_FLAG_Fortran)

22
# Fortran-specific feature flags.
23
set(CMAKE_Fortran_MODDIR_FLAG -J)