Browse Source

BUG: fix -D escaped quotes for watcom

Bill Hoffman 18 years ago
parent
commit
76dd86b410

+ 1 - 0
Source/cmLocalGenerator.cxx

@@ -2074,6 +2074,7 @@ void cmLocalGenerator::AppendFlags(std::string& flags,
 {
   if(newFlags && *newFlags)
     {
+    std::string newf = newFlags;
     if(flags.size())
       {
       flags += " ";

+ 1 - 1
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); 
 

+ 17 - 0
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

+ 3 - 0
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 };