diff options
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 4f17408..7eac169 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -2675,33 +2675,35 @@ bool cmGlobalNinjaMultiGenerator::OpenBuildFileStreams() << "# This file contains build statements common to all " "configurations.\n\n"; - for (auto const& config : this->Makefiles[0]->GetGeneratorConfigs( - cmMakefile::IncludeEmptyConfig)) { - // Open impl file. - if (!this->OpenFileStream(this->ImplFileStreams[config], - GetNinjaImplFilename(config))) { - return false; - } + auto const& configs = + this->Makefiles[0]->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); + return std::all_of( + configs.begin(), configs.end(), [this](std::string const& config) -> bool { + // Open impl file. + if (!this->OpenFileStream(this->ImplFileStreams[config], + GetNinjaImplFilename(config))) { + return false; + } - // Write a comment about this file. - *this->ImplFileStreams[config] - << "# This file contains build statements specific to the \"" << config - << "\"\n# configuration.\n\n"; + // Write a comment about this file. + *this->ImplFileStreams[config] + << "# This file contains build statements specific to the \"" << config + << "\"\n# configuration.\n\n"; - // Open config file. - if (!this->OpenFileStream(this->ConfigFileStreams[config], - GetNinjaConfigFilename(config))) { - return false; - } + // Open config file. + if (!this->OpenFileStream(this->ConfigFileStreams[config], + GetNinjaConfigFilename(config))) { + return false; + } - // Write a comment about this file. - *this->ConfigFileStreams[config] - << "# This file contains aliases specific to the \"" << config - << "\"\n# configuration.\n\n" - << "include " << GetNinjaImplFilename(config) << "\n\n"; - } + // Write a comment about this file. + *this->ConfigFileStreams[config] + << "# This file contains aliases specific to the \"" << config + << "\"\n# configuration.\n\n" + << "include " << GetNinjaImplFilename(config) << "\n\n"; - return true; + return true; + }); } void cmGlobalNinjaMultiGenerator::CloseBuildFileStreams() |