diff options
author | Brad King <brad.king@kitware.com> | 2020-03-27 11:49:44 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-03-27 11:51:27 (GMT) |
commit | d6119e2305f1461699c5510c5d0ff9f7df798aed (patch) | |
tree | f4d411a02732ebfc97bccff472ee0558b1c31507 /Source/cmLocalNinjaGenerator.cxx | |
parent | a6611577c33538af959348b49aec817dd9649c03 (diff) | |
parent | 3fdd8db3aaf4c804dd24a59913650ad024c8343e (diff) | |
download | CMake-d6119e2305f1461699c5510c5d0ff9f7df798aed.zip CMake-d6119e2305f1461699c5510c5d0ff9f7df798aed.tar.gz CMake-d6119e2305f1461699c5510c5d0ff9f7df798aed.tar.bz2 |
Merge topic 'cleanup-endls-1'
3fdd8db3aa Refactor: Avoid `std::endl` where it's not necessary (part 1)
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4513
Diffstat (limited to 'Source/cmLocalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmLocalNinjaGenerator.cxx | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 7e54f11..e62371d 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -207,9 +207,8 @@ void cmLocalNinjaGenerator::WriteBuildFileTop() void cmLocalNinjaGenerator::WriteProjectHeader(std::ostream& os) { cmGlobalNinjaGenerator::WriteDivider(os); - os << "# Project: " << this->GetProjectName() << std::endl - << "# Configurations: " << cmJoin(this->GetConfigNames(), ", ") - << std::endl; + os << "# Project: " << this->GetProjectName() << '\n' + << "# Configurations: " << cmJoin(this->GetConfigNames(), ", ") << '\n'; cmGlobalNinjaGenerator::WriteDivider(os); } @@ -236,8 +235,7 @@ void cmLocalNinjaGenerator::WriteNinjaRequiredVersion(std::ostream& os) cmGlobalNinjaGenerator::WriteComment( os, "Minimal version of Ninja required by this file"); - os << "ninja_required_version = " << requiredVersion << std::endl - << std::endl; + os << "ninja_required_version = " << requiredVersion << "\n\n"; } void cmLocalNinjaGenerator::WriteNinjaConfigurationVariable( @@ -266,9 +264,8 @@ void cmLocalNinjaGenerator::WritePools(std::ostream& os) unsigned int jobs; if (eq != std::string::npos && sscanf(pool.c_str() + eq, "=%u", &jobs) == 1) { - os << "pool " << pool.substr(0, eq) << std::endl; - os << " depth = " << jobs << std::endl; - os << std::endl; + os << "pool " << pool.substr(0, eq) << "\n depth = " << jobs + << "\n\n"; } else { cmSystemTools::Error("Invalid pool defined by property 'JOB_POOLS': " + pool); @@ -280,8 +277,7 @@ void cmLocalNinjaGenerator::WritePools(std::ostream& os) void cmLocalNinjaGenerator::WriteNinjaFilesInclusionConfig(std::ostream& os) { cmGlobalNinjaGenerator::WriteDivider(os); - os << "# Include auxiliary files.\n" - << "\n"; + os << "# Include auxiliary files.\n\n"; cmGlobalNinjaGenerator* ng = this->GetGlobalNinjaGenerator(); std::string const ninjaCommonFile = ng->NinjaOutputPath(cmGlobalNinjaMultiGenerator::NINJA_COMMON_FILE); @@ -294,8 +290,7 @@ void cmLocalNinjaGenerator::WriteNinjaFilesInclusionConfig(std::ostream& os) void cmLocalNinjaGenerator::WriteNinjaFilesInclusionCommon(std::ostream& os) { cmGlobalNinjaGenerator::WriteDivider(os); - os << "# Include auxiliary files.\n" - << "\n"; + os << "# Include auxiliary files.\n\n"; cmGlobalNinjaGenerator* ng = this->GetGlobalNinjaGenerator(); std::string const ninjaRulesFile = ng->NinjaOutputPath(cmGlobalNinjaGenerator::NINJA_RULES_FILE); @@ -308,14 +303,14 @@ void cmLocalNinjaGenerator::WriteNinjaFilesInclusionCommon(std::ostream& os) void cmLocalNinjaGenerator::WriteProcessedMakefile(std::ostream& os) { cmGlobalNinjaGenerator::WriteDivider(os); - os << "# Write statements declared in CMakeLists.txt:" << std::endl + os << "# Write statements declared in CMakeLists.txt:\n" << "# " << this->Makefile->GetDefinition("CMAKE_CURRENT_LIST_FILE") - << std::endl; + << '\n'; if (this->IsRootMakefile()) { - os << "# Which is the root file." << std::endl; + os << "# Which is the root file.\n"; } cmGlobalNinjaGenerator::WriteDivider(os); - os << std::endl; + os << '\n'; } void cmLocalNinjaGenerator::AppendTargetOutputs(cmGeneratorTarget* target, |