summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRaul Laasner <raullaasner@gmail.com>2017-08-16 18:12:35 (GMT)
committerBrad King <brad.king@kitware.com>2017-08-23 19:32:44 (GMT)
commit90a34ff79196c90b64ab16066f957e51a78a7375 (patch)
tree2ba98401066f29831a7e90e2806f63e4f3a7653f /Modules
parentf59d8e5982f5716fb912a795ed93f808e4791532 (diff)
downloadCMake-90a34ff79196c90b64ab16066f957e51a78a7375.zip
CMake-90a34ff79196c90b64ab16066f957e51a78a7375.tar.gz
CMake-90a34ff79196c90b64ab16066f957e51a78a7375.tar.bz2
Ninja: Fix references to source files in gfortran diagnostics
The Ninja generator preprocesses and compiles separately for Fortran. When compiling, tell gfortran that the source is already preprocessed so that it will honor the `# <line>` directives when producing diagnostics messages. Fixes: #17160
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Compiler/GNU-Fortran.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/Compiler/GNU-Fortran.cmake b/Modules/Compiler/GNU-Fortran.cmake
index 94dc275..c333d50 100644
--- a/Modules/Compiler/GNU-Fortran.cmake
+++ b/Modules/Compiler/GNU-Fortran.cmake
@@ -7,6 +7,8 @@ set(CMAKE_Fortran_PREPROCESS_SOURCE
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form")
+set(CMAKE_Fortran_POSTPROCESS_FLAG "-fpreprocessed")
+
# No -DNDEBUG for Fortran.
string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " -Os")
string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " -O3")