It is correct version of patch.
Jiri
>From 9d0913c8b136c8ee6dd32c1bdc0e11f22e37b82f Mon Sep 17 00:00:00 2001
From: Jiri Malak <[email protected]>
Date: Wed, 26 Mar 2014 23:34:17 +0100
Subject: [PATCH] Correct single quote processing for Watcom linker on POSIX
hosts.
---
Source/cmLocalUnixMakefileGenerator3.cxx | 29 ++++++++++++++++++++++++++---
Source/cmLocalUnixMakefileGenerator3.h | 2 +-
Source/cmMakefileTargetGenerator.cxx | 7 ++++---
3 files changed, 31 insertions(+), 7 deletions(-)
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 7e55838..daa587a 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -2182,14 +2182,26 @@ cmLocalUnixMakefileGenerator3
//----------------------------------------------------------------------------
std::string
cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p,
- const char* quote)
+ bool useSingleQuote)
{
// Split the path into its components.
std::vector<std::string> components;
cmSystemTools::SplitPath(p, components);
// Open the quoted result.
- std::string result = quote;
+ std::string result;
+ if( useSingleQuote)
+ {
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ result = "'";
+#else
+ result = "\"'";
+#endif
+ }
+ else
+ {
+ result = "\"";
+ }
// Return an empty path if there are no components.
if(!components.empty())
@@ -2233,7 +2245,18 @@ cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p,
}
// Close the quoted result.
- result += quote;
+ if( useSingleQuote)
+ {
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ result += "'";
+#else
+ result += "'\"";
+#endif
+ }
+ else
+ {
+ result += "\"";
+ }
return result;
}
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 2871cba..0aa804a 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -187,7 +187,7 @@ public:
cmLocalGenerator::RelativeRoot returnDir);
static std::string ConvertToQuotedOutputPath(const char* p,
- const char* quote);
+ bool useSingleQuote);
std::string CreateMakeVariable(const std::string& sin,
const std::string& s2in);
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 4ebd334..92dd29b 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1354,7 +1354,6 @@ cmMakefileTargetGenerator
{
// Write a make variable assignment that lists all objects for the
// target.
- char const* quote = (useSingleQuote) ? "'" : "\"";
variableName =
this->LocalGenerator->CreateMakeVariable(this->Target->GetName(),
"_OBJECTS");
@@ -1373,7 +1372,8 @@ cmMakefileTargetGenerator
{
*this->BuildFileStream << " " << lineContinue << "\n";
*this->BuildFileStream <<
- this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str(), quote);
+ this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str(),
+ useSingleQuote);
}
*this->BuildFileStream << "\n";
@@ -1396,7 +1396,8 @@ cmMakefileTargetGenerator
<< " " << lineContinue << "\n"
<< this->Makefile->GetSafeDefinition("CMAKE_OBJECT_NAME");
*this->BuildFileStream <<
- this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str(), quote);
+ this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str(),
+ useSingleQuote);
}
*this->BuildFileStream << "\n" << "\n";
}
--
1.8.1.4
--
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