diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2012-05-16 22:57:09 (GMT) |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2012-05-16 23:00:16 (GMT) |
commit | b94514f02018d566abc0156d5a729ebe9ee49105 (patch) | |
tree | 576988e1fd1eca8cee8aeb289751968ea3cb9ff1 /Source/cmGlobalNinjaGenerator.cxx | |
parent | e78483c08e1f7753509afa4d4aab94274cd6b861 (diff) | |
download | CMake-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.cxx | 5 |
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(); } |