I did it.
New patch is enclosed.

Regards

Jiri

> On 03/26/2014 06:38 PM, Jiri Malak wrote:
>> It is correct version of patch.
>
> Thanks.
>
>> +  if( useSingleQuote)
>> +    {
>> +#if defined(_WIN32) && !defined(__CYGWIN__)
>> +    result = "'";
>> +#else
>> +    result = "\"'";
>> +#endif
>
> This quoting style is now very specific to Watcom.  Please
> add another patch on top of this to rename:
>
>  useSingleQuote => useWatcomQuote
>  _USE_SINGLE_QUOTE => _USE_WATCOM_QUOTE
>
> I will squash them all together and update the commit message
> accordingly.
>
> Thanks,
> -Brad
>
>
>From 0f1c62699401046f204a7c7d9de3cafa552b252e Mon Sep 17 00:00:00 2001
From: Jiri Malak <[email protected]>
Date: Thu, 27 Mar 2014 18:20:03 +0100
Subject: [PATCH] Correct single quote processing for Watcom linker.

---
 Modules/Platform/Windows-wcl386.cmake          |  4 ++--
 Source/cmLocalUnixMakefileGenerator3.cxx       |  6 +++---
 Source/cmLocalUnixMakefileGenerator3.h         |  2 +-
 Source/cmMakefileExecutableTargetGenerator.cxx |  4 ++--
 Source/cmMakefileLibraryTargetGenerator.cxx    |  4 ++--
 Source/cmMakefileTargetGenerator.cxx           | 10 +++++-----
 Source/cmMakefileTargetGenerator.h             |  4 ++--
 7 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/Modules/Platform/Windows-wcl386.cmake 
b/Modules/Platform/Windows-wcl386.cmake
index 359097f..617761b 100644
--- a/Modules/Platform/Windows-wcl386.cmake
+++ b/Modules/Platform/Windows-wcl386.cmake
@@ -40,8 +40,8 @@ set (CMAKE_C_STANDARD_LIBRARIES_INIT "library clbrdll.lib 
library plbrdll.lib  l
 set (CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
 
 foreach(type CREATE_SHARED_LIBRARY CREATE_SHARED_MODULE LINK_EXECUTABLE)
-  set(CMAKE_C_${type}_USE_SINGLE_QUOTE 1)
-  set(CMAKE_CXX_${type}_USE_SINGLE_QUOTE 1)
+  set(CMAKE_C_${type}_USE_WATCOM_QUOTE 1)
+  set(CMAKE_CXX_${type}_USE_WATCOM_QUOTE 1)
 endforeach()
 
 set(CMAKE_C_CREATE_IMPORT_LIBRARY
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx 
b/Source/cmLocalUnixMakefileGenerator3.cxx
index fa81913..9fe9843 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -2182,14 +2182,14 @@ cmLocalUnixMakefileGenerator3
 //----------------------------------------------------------------------------
 std::string
 cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p,
-                                                         bool useSingleQuote)
+                                                         bool useWatcomQuote)
 {
   // Split the path into its components.
   std::vector<std::string> components;
   cmSystemTools::SplitPath(p, components);
 
   // Open the quoted result.
-  if( useSingleQuote)
+  if( useWatcomQuote)
     {
 #if defined(_WIN32) && !defined(__CYGWIN__)
     std::string result = "'";
@@ -2244,7 +2244,7 @@ 
cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p,
     }
 
   // Close the quoted result.
-  if( useSingleQuote)
+  if( useWatcomQuote)
     {
 #if defined(_WIN32) && !defined(__CYGWIN__)
     result += "'";
diff --git a/Source/cmLocalUnixMakefileGenerator3.h 
b/Source/cmLocalUnixMakefileGenerator3.h
index 0aa804a..99974ee 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -187,7 +187,7 @@ public:
                        cmLocalGenerator::RelativeRoot returnDir);
 
   static std::string ConvertToQuotedOutputPath(const char* p,
-                                               bool useSingleQuote);
+                                               bool useWatcomQuote);
 
   std::string CreateMakeVariable(const std::string& sin,
                                  const std::string& s2in);
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx 
b/Source/cmMakefileExecutableTargetGenerator.cxx
index a392780..701d5a0 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -290,7 +290,7 @@ void 
cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
   linkRuleVar += linkLanguage;
   linkRuleVar += "_LINK_EXECUTABLE";
   std::string linkRule = this->GetLinkRule(linkRuleVar);
-  bool useSingleQuote = this->Makefile->IsOn(linkRuleVar+"_USE_SINGLE_QUOTE");
+  bool useWatcomQuote = this->Makefile->IsOn(linkRuleVar+"_USE_WATCOM_QUOTE");
   std::vector<std::string> commands1;
   cmSystemTools::ExpandListArgument(linkRule, real_link_commands);
   if(this->Target->IsExecutableWithExports())
@@ -345,7 +345,7 @@ void 
cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
   std::string buildObjs;
   this->CreateObjectLists(useLinkScript, false,
                           useResponseFileForObjects, buildObjs, depends,
-                          useSingleQuote);
+                          useWatcomQuote);
 
   cmLocalGenerator::RuleVariables vars;
   vars.RuleLauncher = "RULE_LAUNCH_LINK";
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx 
b/Source/cmMakefileLibraryTargetGenerator.cxx
index eea1b02..754f62f 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -458,7 +458,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
                              this->Target);
     }
 
-  bool useSingleQuote = this->Makefile->IsOn(linkRuleVar+"_USE_SINGLE_QUOTE");
+  bool useWatcomQuote = this->Makefile->IsOn(linkRuleVar+"_USE_WATCOM_QUOTE");
 
   // Determine whether a link script will be used.
   bool useLinkScript = this->GlobalGenerator->GetUseLinkScript();
@@ -556,7 +556,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
   std::string buildObjs;
   this->CreateObjectLists(useLinkScript, useArchiveRules,
                           useResponseFileForObjects, buildObjs, depends,
-                          useSingleQuote);
+                          useWatcomQuote);
 
   cmLocalGenerator::RuleVariables vars;
   vars.TargetPDB = targetOutPathPDB.c_str();
diff --git a/Source/cmMakefileTargetGenerator.cxx 
b/Source/cmMakefileTargetGenerator.cxx
index 92dd29b..b3d3f71 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1350,7 +1350,7 @@ void
 cmMakefileTargetGenerator
 ::WriteObjectsVariable(std::string& variableName,
                        std::string& variableNameExternal,
-                       bool useSingleQuote)
+                       bool useWatcomQuote)
 {
   // Write a make variable assignment that lists all objects for the
   // target.
@@ -1373,7 +1373,7 @@ cmMakefileTargetGenerator
     *this->BuildFileStream << " " << lineContinue << "\n";
     *this->BuildFileStream  <<
       this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str(),
-                                                      useSingleQuote);
+                                                      useWatcomQuote);
     }
   *this->BuildFileStream << "\n";
 
@@ -1397,7 +1397,7 @@ cmMakefileTargetGenerator
       << this->Makefile->GetSafeDefinition("CMAKE_OBJECT_NAME");
     *this->BuildFileStream  <<
       this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str(),
-                                                      useSingleQuote);
+                                                      useWatcomQuote);
     }
   *this->BuildFileStream << "\n" << "\n";
 }
@@ -1866,12 +1866,12 @@ cmMakefileTargetGenerator
 ::CreateObjectLists(bool useLinkScript, bool useArchiveRules,
                     bool useResponseFile, std::string& buildObjs,
                     std::vector<std::string>& makefile_depends,
-                    bool useSingleQuote)
+                    bool useWatcomQuote)
 {
   std::string variableName;
   std::string variableNameExternal;
   this->WriteObjectsVariable(variableName, variableNameExternal,
-                             useSingleQuote);
+                             useWatcomQuote);
   if(useResponseFile)
     {
     // MSVC response files cannot exceed 128K.
diff --git a/Source/cmMakefileTargetGenerator.h 
b/Source/cmMakefileTargetGenerator.h
index 0e10b62..ff94660 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -114,7 +114,7 @@ protected:
   // write out the variable that lists the objects for this target
   void WriteObjectsVariable(std::string& variableName,
                             std::string& variableNameExternal,
-                            bool useSingleQuote);
+                            bool useWatcomQuote);
   void WriteObjectsString(std::string& buildObjs);
   void WriteObjectsStrings(std::vector<std::string>& objStrings,
                            std::string::size_type limit = std::string::npos);
@@ -174,7 +174,7 @@ protected:
   void CreateObjectLists(bool useLinkScript, bool useArchiveRules,
                          bool useResponseFile, std::string& buildObjs,
                          std::vector<std::string>& makefile_depends,
-                         bool useSingleQuote);
+                         bool useWatcomQuote);
 
   void AddIncludeFlags(std::string& flags, const std::string& lang);
 
-- 
1.8.0.msysgit.0
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to