summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-08-24 13:33:18 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-08-24 13:33:55 (GMT)
commit94299c496d54d037db35575447b011c6c8a35b0a (patch)
tree3d87c668a7f5a97a2bc3d7d46906a32840522eb7 /Source
parent061b4f24be8281a1504f6993602d79b61b862d6d (diff)
parent90a34ff79196c90b64ab16066f957e51a78a7375 (diff)
downloadCMake-94299c496d54d037db35575447b011c6c8a35b0a.zip
CMake-94299c496d54d037db35575447b011c6c8a35b0a.tar.gz
CMake-94299c496d54d037db35575447b011c6c8a35b0a.tar.bz2
Merge topic 'ninja-gfortran-fpreprocessed'
90a34ff7 Ninja: Fix references to source files in gfortran diagnostics Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1146
Diffstat (limited to 'Source')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 7cc6ede..4b16dc7 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -891,9 +891,15 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
// The actual compilation will now use the preprocessed source.
explicitDeps.push_back(ppFileName);
- // Preprocessing and compilation use the same flags.
+ // Preprocessing and compilation generally use the same flags.
ppVars["FLAGS"] = vars["FLAGS"];
+ // In case compilation requires flags that are incompatible with
+ // preprocessing, include them here.
+ std::string const postFlag =
+ this->Makefile->GetSafeDefinition("CMAKE_Fortran_POSTPROCESS_FLAG");
+ this->LocalGenerator->AppendFlags(vars["FLAGS"], postFlag);
+
// Move preprocessor definitions to the preprocessor build statement.
std::swap(ppVars["DEFINES"], vars["DEFINES"]);