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 2012-05-16 23:57:09 +01:00
parent e78483c08e
commit b94514f020
1 changed files with 5 additions and 0 deletions

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();
}