summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorYan Pashkovsky <yanp.bugz@gmail.com>2018-12-14 15:23:53 (GMT)
committerYan Pashkovsky <yanp.bugz@gmail.com>2018-12-14 15:23:53 (GMT)
commit37c6a02dc27154881c8b6b03beb7a17528ed5907 (patch)
tree11f6480b89a17418717b05b04514ad93421381f4 /Source/cmMakefileTargetGenerator.cxx
parent7583f7490e23e025d9072533990f7cd9fec4b61d (diff)
downloadCMake-37c6a02dc27154881c8b6b03beb7a17528ed5907.zip
CMake-37c6a02dc27154881c8b6b03beb7a17528ed5907.tar.gz
CMake-37c6a02dc27154881c8b6b03beb7a17528ed5907.tar.bz2
CMake: fix nmake compile_commands generation
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 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);
}