summaryrefslogtreecommitdiff
path: root/Source/cmGlobalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-03-27 11:49:44 +0000
committerKitware Robot <kwrobot@kitware.com>2020-03-27 07:51:27 -0400
commitd6119e2305f1461699c5510c5d0ff9f7df798aed (patch)
treef4d411a02732ebfc97bccff472ee0558b1c31507 /Source/cmGlobalUnixMakefileGenerator3.cxx
parenta6611577c33538af959348b49aec817dd9649c03 (diff)
parent3fdd8db3aaf4c804dd24a59913650ad024c8343e (diff)
downloadcmake-d6119e2305f1461699c5510c5d0ff9f7df798aed.tar.gz
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/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 679d24451d..582877f845 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -159,7 +159,7 @@ void cmGlobalUnixMakefileGenerator3::Generate()
this->WriteMainCMakefile();
if (this->CommandDatabase) {
- *this->CommandDatabase << std::endl << "]";
+ *this->CommandDatabase << "\n]";
this->CommandDatabase.reset();
}
}
@@ -174,21 +174,20 @@ void cmGlobalUnixMakefileGenerator3::AddCXXCompileCommand(
"/compile_commands.json";
this->CommandDatabase =
cm::make_unique<cmGeneratedFileStream>(commandDatabaseName);
- *this->CommandDatabase << "[" << std::endl;
+ *this->CommandDatabase << "[\n";
} else {
- *this->CommandDatabase << "," << std::endl;
+ *this->CommandDatabase << ",\n";
}
- *this->CommandDatabase << "{" << std::endl
+ *this->CommandDatabase << "{\n"
<< R"( "directory": ")"
<< cmGlobalGenerator::EscapeJSON(workingDirectory)
- << "\"," << std::endl
+ << "\",\n"
<< R"( "command": ")"
<< cmGlobalGenerator::EscapeJSON(compileCommand)
- << "\"," << std::endl
+ << "\",\n"
<< R"( "file": ")"
- << cmGlobalGenerator::EscapeJSON(sourceFile) << "\""
- << std::endl
- << "}";
+ << cmGlobalGenerator::EscapeJSON(sourceFile)
+ << "\"\n}";
}
void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()