This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, master has been updated via 6f904d01009bf26d129b2a2f0335e99bf30732ac (commit) via 37c6a02dc27154881c8b6b03beb7a17528ed5907 (commit) via 7583f7490e23e025d9072533990f7cd9fec4b61d (commit) from c1e9b1c283caccd468adfafd0496edd63964b899 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6f904d01009bf26d129b2a2f0335e99bf30732ac commit 6f904d01009bf26d129b2a2f0335e99bf30732ac Merge: c1e9b1c 37c6a02 Author: Craig Scott <craig.sc...@crascit.com> AuthorDate: Mon Jan 7 20:26:44 2019 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Mon Jan 7 15:26:55 2019 -0500 Merge topic 'nmake-compile-commands' 37c6a02dc2 CMake: fix nmake compile_commands generation 7583f7490e cmGlobalGenerator: Teach EscapeJSON to escape newlines and tabs Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !2648 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=37c6a02dc27154881c8b6b03beb7a17528ed5907 commit 37c6a02dc27154881c8b6b03beb7a17528ed5907 Author: Yan Pashkovsky <yanp.b...@gmail.com> AuthorDate: Fri Dec 14 18:23:53 2018 +0300 Commit: Yan Pashkovsky <yanp.b...@gmail.com> CommitDate: Fri Dec 14 18:23:53 2018 +0300 CMake: fix nmake compile_commands generation diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 9acae49..0ea9724 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -687,6 +687,17 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( std::string langIncludes = std::string("$(") + lang + "_INCLUDES)"; compileCommand.replace(compileCommand.find(langIncludes), langIncludes.size(), this->GetIncludes(lang)); + + const char* eliminate[] = { + this->Makefile->GetDefinition("CMAKE_START_TEMP_FILE"), + this->Makefile->GetDefinition("CMAKE_END_TEMP_FILE") + }; + for (const char* el : eliminate) { + if (el) { + cmSystemTools::ReplaceString(compileCommand, el, ""); + } + } + this->GlobalGenerator->AddCXXCompileCommand( source.GetFullPath(), workingDirectory, compileCommand); } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7583f7490e23e025d9072533990f7cd9fec4b61d commit 7583f7490e23e025d9072533990f7cd9fec4b61d Author: Yan Pashkovsky <yanp.b...@gmail.com> AuthorDate: Fri Dec 14 18:23:20 2018 +0300 Commit: Yan Pashkovsky <yanp.b...@gmail.com> CommitDate: Fri Dec 14 18:23:20 2018 +0300 cmGlobalGenerator: Teach EscapeJSON to escape newlines and tabs diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 2805395..9326e5f 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -3014,11 +3014,23 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target) std::string cmGlobalGenerator::EscapeJSON(const std::string& s) { std::string result; + result.reserve(s.size()); for (char i : s) { - if (i == '"' || i == '\\') { - result += '\\'; + switch (i) { + case '"': + case '\\': + result += '\\'; + result += i; + break; + case '\n': + result += "\\n"; + break; + case '\t': + result += "\\t"; + break; + default: + result += i; } - result += i; } return result; } ----------------------------------------------------------------------- Summary of changes: Source/cmGlobalGenerator.cxx | 18 +++++++++++++++--- Source/cmMakefileTargetGenerator.cxx | 11 +++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org https://cmake.org/mailman/listinfo/cmake-commits