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.
This commit is contained in:
Peter Collingbourne committed 2012-05-17 00:00:16 +01:00
1 parent e78483c08e
commit b94514f020
1 file changed
+5
+5
View File
@@ -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();
}