summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2012-05-16 22:57:09 (GMT)
committerPeter Collingbourne <peter@pcc.me.uk>2012-05-16 23:00:16 (GMT)
commitb94514f02018d566abc0156d5a729ebe9ee49105 (patch)
tree576988e1fd1eca8cee8aeb289751968ea3cb9ff1 /Source/cmGlobalNinjaGenerator.cxx
parente78483c08e1f7753509afa4d4aab94274cd6b861 (diff)
downloadCMake-b94514f02018d566abc0156d5a729ebe9ee49105.zip
CMake-b94514f02018d566abc0156d5a729ebe9ee49105.tar.gz
CMake-b94514f02018d566abc0156d5a729ebe9ee49105.tar.bz2
Ninja: mark rules/build file streams failed if error occurred (#13067, #13105)
This causes cmGeneratedFileStream to delete the temporary files, rather than overwriting the (working) existing files.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 9cbd502..5f52e1d 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -385,6 +385,11 @@ void cmGlobalNinjaGenerator::Generate()
this->WriteTargetAliases(*this->BuildFileStream);
this->WriteBuiltinTargets(*this->BuildFileStream);
+ if (cmSystemTools::GetErrorOccuredFlag()) {
+ this->RulesFileStream->setstate(std::ios_base::failbit);
+ this->BuildFileStream->setstate(std::ios_base::failbit);
+ }
+
this->CloseRulesFileStream();
this->CloseBuildFileStream();
}