mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
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.
This commit is contained in:
@@ -2181,14 +2181,27 @@ cmLocalUnixMakefileGenerator3
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
std::string
|
||||
cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p)
|
||||
cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p,
|
||||
bool useWatcomQuote)
|
||||
{
|
||||
// Split the path into its components.
|
||||
std::vector<std::string> components;
|
||||
cmSystemTools::SplitPath(p, components);
|
||||
|
||||
// Open the quoted result.
|
||||
std::string result = "\"";
|
||||
std::string result;
|
||||
if(useWatcomQuote)
|
||||
{
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
result = "'";
|
||||
#else
|
||||
result = "\"'";
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
result = "\"";
|
||||
}
|
||||
|
||||
// Return an empty path if there are no components.
|
||||
if(!components.empty())
|
||||
@@ -2232,7 +2245,18 @@ cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p)
|
||||
}
|
||||
|
||||
// Close the quoted result.
|
||||
result += "\"";
|
||||
if(useWatcomQuote)
|
||||
{
|
||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||
result += "'";
|
||||
#else
|
||||
result += "'\"";
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
result += "\"";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user