summaryrefslogtreecommitdiff
path: root/Modules/Compiler/GNU-Fortran.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/Compiler/GNU-Fortran.cmake')
-rw-r--r--Modules/Compiler/GNU-Fortran.cmake13
1 files changed, 7 insertions, 6 deletions
diff --git a/Modules/Compiler/GNU-Fortran.cmake b/Modules/Compiler/GNU-Fortran.cmake
index 313ccbd02..94dc2755a 100644
--- a/Modules/Compiler/GNU-Fortran.cmake
+++ b/Modules/Compiler/GNU-Fortran.cmake
@@ -1,17 +1,18 @@
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.
-set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os")
-set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3")
+string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " -Os")
+string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O3")
-# We require updates to CMake C++ code to support preprocessing rules
-# for Fortran.
-set(CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE)
-set(CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE)
+# 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)