summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorJiri Malak <malak.jiri@gmail.com>2014-04-04 21:06:13 (GMT)
committerBrad King <brad.king@kitware.com>2014-04-08 17:28:54 (GMT)
commitcb9b1e13e4de88deb1d675ee26859615c393e9c5 (patch)
tree05bea6450b10c2aab9067c1062cb55afcebe9629 /Source/cmLocalGenerator.cxx
parent9b1abc543e9aee946e093229e1715c4b8a961514 (diff)
downloadCMake-cb9b1e13e4de88deb1d675ee26859615c393e9c5.zip
CMake-cb9b1e13e4de88deb1d675ee26859615c393e9c5.tar.gz
CMake-cb9b1e13e4de88deb1d675ee26859615c393e9c5.tar.bz2
Watcom: Use single quote for all file/path items in wlink command
Watcom Linker use single quote if necessary for quoting target name, libraries names and libraries search path. Object names were already fixed.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx34
1 files changed, 21 insertions, 13 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 1e65a02..8e56d2f 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -689,6 +689,7 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang,
std::string createRule = "CMAKE_";
createRule += llang;
createRule += target.GetCreateRuleVariable();
+ bool useWatcomQuote = this->Makefile->IsOn(createRule+"_USE_WATCOM_QUOTE");
std::string targetName = target.Target->GetFullName();
// Executable :
// Shared Library:
@@ -700,7 +701,7 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang,
std::string flags; // should be set
std::string linkFlags; // should be set
this->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags,
- &target);
+ &target, useWatcomQuote);
linkLibs = frameworkPath + linkPath + linkLibs;
cmLocalGenerator::RuleVariables vars;
vars.Language = llang.c_str();
@@ -1611,7 +1612,8 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
std::string& linkFlags,
std::string& frameworkPath,
std::string& linkPath,
- cmGeneratorTarget* target)
+ cmGeneratorTarget* target,
+ bool useWatcomQuote)
{
std::string buildType =
this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
@@ -1675,7 +1677,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
}
}
this->OutputLinkLibraries(linkLibs, frameworkPath, linkPath,
- *target, false, false);
+ *target, false, false, useWatcomQuote);
}
break;
case cmTarget::EXECUTABLE:
@@ -1700,7 +1702,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
}
this->AddLanguageFlags(flags, linkLanguage, buildType);
this->OutputLinkLibraries(linkLibs, frameworkPath, linkPath,
- *target, false, false);
+ *target, false, false, useWatcomQuote);
if(cmSystemTools::IsOn
(this->Makefile->GetDefinition("BUILD_SHARED_LIBS")))
{
@@ -1759,9 +1761,8 @@ std::string cmLocalGenerator::ConvertToLinkReference(std::string const& lib,
OutputFormat format)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
- // Work-ardound command line parsing limitations in MSVC 6.0 and
- // Watcom.
- if(this->Makefile->IsOn("MSVC60") || this->Makefile->IsOn("WATCOM"))
+ // Work-ardound command line parsing limitations in MSVC 6.0
+ if(this->Makefile->IsOn("MSVC60"))
{
// Search for the last space.
std::string::size_type pos = lib.rfind(' ');
@@ -1798,9 +1799,11 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
std::string& linkPath,
cmGeneratorTarget &tgt,
bool relink,
- bool forResponseFile)
+ bool forResponseFile,
+ bool useWatcomQuote)
{
- OutputFormat shellFormat = forResponseFile? RESPONSE : SHELL;
+ OutputFormat shellFormat = (forResponseFile) ? RESPONSE :
+ ((useWatcomQuote) ? WATCOMQUOTE : SHELL);
bool escapeAllowMakeVars = !forResponseFile;
cmOStringStream fout;
const char* config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
@@ -2594,7 +2597,7 @@ std::string cmLocalGenerator::ConvertToOutputFormat(const std::string& source,
{
result = cmSystemTools::ConvertToOutputPath(result.c_str());
}
- else if( output == SHELL)
+ else if(output == SHELL || output == WATCOMQUOTE)
{
// For the MSYS shell convert drive letters to posix paths, so
// that c:/some/path becomes /c/some/path. This is needed to
@@ -2616,11 +2619,11 @@ std::string cmLocalGenerator::ConvertToOutputFormat(const std::string& source,
pos++;
}
}
- result = this->EscapeForShell(result, true, false);
+ result = this->EscapeForShell(result, true, false, output == WATCOMQUOTE);
}
else if(output == RESPONSE)
{
- result = this->EscapeForShell(result, false, false);
+ result = this->EscapeForShell(result, false, false, false);
}
return result;
}
@@ -3247,7 +3250,8 @@ static bool cmLocalGeneratorIsShellOperator(const std::string& str)
//----------------------------------------------------------------------------
std::string cmLocalGenerator::EscapeForShell(const std::string& str,
bool makeVars,
- bool forEcho)
+ bool forEcho,
+ bool useWatcomQuote)
{
// Do not escape shell operators.
if(cmLocalGeneratorIsShellOperator(str))
@@ -3273,6 +3277,10 @@ std::string cmLocalGenerator::EscapeForShell(const std::string& str,
{
flags |= cmsysSystem_Shell_Flag_EchoWindows;
}
+ if(useWatcomQuote)
+ {
+ flags |= cmsysSystem_Shell_Flag_WatcomQuote;
+ }
if(this->WatcomWMake)
{
flags |= cmsysSystem_Shell_Flag_WatcomWMake;