diff options
author | Jiri Malak <malak.jiri@gmail.com> | 2014-03-25 06:17:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-03-27 17:45:29 (GMT) |
commit | 423009c17f50f837bca178a2cc5edfd62963f1ea (patch) | |
tree | 152751e8bd297948ac33517d2c8fc89e45e179df /Source/cmMakefileTargetGenerator.cxx | |
parent | a863a8fecd368f3b17930dd7832fb2e0ba042616 (diff) | |
download | CMake-423009c17f50f837bca178a2cc5edfd62963f1ea.zip CMake-423009c17f50f837bca178a2cc5edfd62963f1ea.tar.gz CMake-423009c17f50f837bca178a2cc5edfd62963f1ea.tar.bz2 |
Makefile: Generate single-quoted object lists for Watcom
Drop the CMAKE_NO_QUOTED_OBJECTS internal variable from the Makefile
generators. The underlying problem is with the Watcom linker, not with
WMake. The Watcom linker wants object files to be single-quoted. Add
<LINK-RULE>_USE_WATCOM_QUOTE platform information variables to tell the
generators to use Watcom-style single quotes for object files on link
lines.
On Windows, Watcom uses the GetCommandLine API to get the original
command-line string and do custom parsing that expects single quotes.
On POSIX systems, Watcom approximates the original command line by
joining all argv[] entries separated by a single space. Therefore we
need to double-quote the single-quoted arguments so that the shell does
not consume them and they are available for the parser to see.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 6759d05..b3d3f71 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1349,7 +1349,8 @@ cmMakefileTargetGenerator::AppendProgress(std::vector<std::string>& commands) void cmMakefileTargetGenerator ::WriteObjectsVariable(std::string& variableName, - std::string& variableNameExternal) + std::string& variableNameExternal, + bool useWatcomQuote) { // Write a make variable assignment that lists all objects for the // target. @@ -1360,8 +1361,6 @@ cmMakefileTargetGenerator << "# Object files for target " << this->Target->GetName() << "\n" << variableName << " ="; std::string object; - const char* objName = - this->Makefile->GetDefinition("CMAKE_NO_QUOTED_OBJECTS"); const char* lineContinue = this->Makefile->GetDefinition("CMAKE_MAKE_LINE_CONTINUE"); if(!lineContinue) @@ -1372,17 +1371,9 @@ cmMakefileTargetGenerator i != this->Objects.end(); ++i) { *this->BuildFileStream << " " << lineContinue << "\n"; - if(objName) - { - *this->BuildFileStream << - this->Convert(*i, cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::MAKEFILE); - } - else - { - *this->BuildFileStream << - this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str()); - } + *this->BuildFileStream << + this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str(), + useWatcomQuote); } *this->BuildFileStream << "\n"; @@ -1404,17 +1395,9 @@ cmMakefileTargetGenerator *this->BuildFileStream << " " << lineContinue << "\n" << this->Makefile->GetSafeDefinition("CMAKE_OBJECT_NAME"); - if(objName) - { - *this->BuildFileStream << - this->Convert(*i, cmLocalGenerator::START_OUTPUT, - cmLocalGenerator::MAKEFILE); - } - else - { - *this->BuildFileStream << - this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str()); - } + *this->BuildFileStream << + this->LocalGenerator->ConvertToQuotedOutputPath(i->c_str(), + useWatcomQuote); } *this->BuildFileStream << "\n" << "\n"; } @@ -1882,11 +1865,13 @@ void cmMakefileTargetGenerator ::CreateObjectLists(bool useLinkScript, bool useArchiveRules, bool useResponseFile, std::string& buildObjs, - std::vector<std::string>& makefile_depends) + std::vector<std::string>& makefile_depends, + bool useWatcomQuote) { std::string variableName; std::string variableNameExternal; - this->WriteObjectsVariable(variableName, variableNameExternal); + this->WriteObjectsVariable(variableName, variableNameExternal, + useWatcomQuote); if(useResponseFile) { // MSVC response files cannot exceed 128K. |