summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2019-01-07 20:26:44 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-01-07 20:26:55 (GMT)
commit6f904d01009bf26d129b2a2f0335e99bf30732ac (patch)
tree30ce374928957ab17d5ed1bc7ba89fad25c0e78c /Source/cmMakefileTargetGenerator.cxx
parentc1e9b1c283caccd468adfafd0496edd63964b899 (diff)
parent37c6a02dc27154881c8b6b03beb7a17528ed5907 (diff)
downloadCMake-6f904d01009bf26d129b2a2f0335e99bf30732ac.zip
CMake-6f904d01009bf26d129b2a2f0335e99bf30732ac.tar.gz
CMake-6f904d01009bf26d129b2a2f0335e99bf30732ac.tar.bz2
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 <kwrobot@kitware.com> Merge-request: !2648
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index cb41c28..d1dcd81 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);
}