From 76dd86b410d0b09e33d2a93d0b4a27b4a8ee7016 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 10 May 2007 14:43:55 -0400 Subject: [PATCH] BUG: fix -D escaped quotes for watcom --- Source/cmLocalGenerator.cxx | 1 + Source/cmLocalGenerator.h | 2 +- Source/cmLocalUnixMakefileGenerator3.cxx | 17 +++++++++++++++++ Source/cmLocalUnixMakefileGenerator3.h | 3 +++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index ec78dafeb..5d7dcdea0 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2074,6 +2074,7 @@ void cmLocalGenerator::AppendFlags(std::string& flags, { if(newFlags && *newFlags) { + std::string newf = newFlags; if(flags.size()) { flags += " "; diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 58a5a1156..38b4c0b4d 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -131,7 +131,7 @@ public: void AddSharedFlags(std::string& flags, const char* lang, bool shared); void AddConfigVariableFlags(std::string& flags, const char* var, const char* config); - void AppendFlags(std::string& flags, const char* newFlags); + virtual void AppendFlags(std::string& flags, const char* newFlags); ///! Get the include flags for the current makefile and language const char* GetIncludeFlags(const char* lang); diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index a48bebbaa..53707505e 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -805,6 +805,23 @@ cmLocalUnixMakefileGenerator3::GetRelativeTargetDirectory(cmTarget& target) +//---------------------------------------------------------------------------- +void cmLocalUnixMakefileGenerator3::AppendFlags(std::string& flags, + const char* newFlags) +{ + if(this->WatcomWMake && newFlags && *newFlags) + { + std::string newf = newFlags; + if(newf.find("\\\"") != newf.npos) + { + cmSystemTools::ReplaceString(newf, "\\\"", "\""); + this->cmLocalGenerator::AppendFlags(flags, newf.c_str()); + return; + } + } + this->cmLocalGenerator::AppendFlags(flags, newFlags); +} + //---------------------------------------------------------------------------- void cmLocalUnixMakefileGenerator3 diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index 9d2b4c305..07d1f953e 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -177,6 +177,9 @@ public: /** used to create a recursive make call */ std::string GetRecursiveMakeCall(const char *makefile, const char* tgt); + // append flags to a string + virtual void AppendFlags(std::string& flags, const char* newFlags); + // append an echo command enum EchoColor { EchoNormal, EchoDepend, EchoBuild, EchoLink, EchoGenerate, EchoGlobal };