Watcom: Fix double-quote to be single-quote in response files for wlink

Response files contained double-quote for any response file, but response files for wlink must contains single-quote. This is fix for libraries list response file. Problem for object file list was fixed by MR
!8115
This commit is contained in:
Jiri Malak 2023-01-25 14:42:20 +01:00
parent ed09c0aecd
commit a6bdf54a5e
3 changed files with 12 additions and 6 deletions

View File

@ -821,7 +821,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
if (useArchiveRules) { if (useArchiveRules) {
// Construct the individual object list strings. // Construct the individual object list strings.
std::vector<std::string> object_strings; std::vector<std::string> object_strings;
this->WriteObjectsStrings(object_strings, archiveCommandLimit); this->WriteObjectsStrings(object_strings, false, archiveCommandLimit);
// Add the cuda device object to the list of archive files. This will // Add the cuda device object to the list of archive files. This will
// only occur on archives which have CUDA_RESOLVE_DEVICE_SYMBOLS enabled // only occur on archives which have CUDA_RESOLVE_DEVICE_SYMBOLS enabled

View File

@ -1888,10 +1888,12 @@ class cmMakefileTargetGeneratorObjectStrings
public: public:
cmMakefileTargetGeneratorObjectStrings(std::vector<std::string>& strings, cmMakefileTargetGeneratorObjectStrings(std::vector<std::string>& strings,
cmOutputConverter* outputConverter, cmOutputConverter* outputConverter,
bool useWatcomQuote,
cmStateDirectory const& stateDir, cmStateDirectory const& stateDir,
std::string::size_type limit) std::string::size_type limit)
: Strings(strings) : Strings(strings)
, OutputConverter(outputConverter) , OutputConverter(outputConverter)
, UseWatcomQuote(useWatcomQuote)
, StateDir(stateDir) , StateDir(stateDir)
, LengthLimit(limit) , LengthLimit(limit)
{ {
@ -1902,7 +1904,7 @@ public:
// Construct the name of the next object. // Construct the name of the next object.
this->NextObject = this->OutputConverter->ConvertToOutputFormat( this->NextObject = this->OutputConverter->ConvertToOutputFormat(
this->OutputConverter->MaybeRelativeToCurBinDir(obj), this->OutputConverter->MaybeRelativeToCurBinDir(obj),
cmOutputConverter::RESPONSE); cmOutputConverter::RESPONSE, this->UseWatcomQuote);
// Roll over to next string if the limit will be exceeded. // Roll over to next string if the limit will be exceeded.
if (this->LengthLimit != std::string::npos && if (this->LengthLimit != std::string::npos &&
@ -1925,6 +1927,7 @@ public:
private: private:
std::vector<std::string>& Strings; std::vector<std::string>& Strings;
cmOutputConverter* OutputConverter; cmOutputConverter* OutputConverter;
bool UseWatcomQuote;
cmStateDirectory StateDir; cmStateDirectory StateDir;
std::string::size_type LengthLimit; std::string::size_type LengthLimit;
std::string CurrentString; std::string CurrentString;
@ -1933,12 +1936,13 @@ private:
}; };
void cmMakefileTargetGenerator::WriteObjectsStrings( void cmMakefileTargetGenerator::WriteObjectsStrings(
std::vector<std::string>& objStrings, std::string::size_type limit) std::vector<std::string>& objStrings, bool useWatcomQuote,
std::string::size_type limit)
{ {
cmValue pchExtension = this->Makefile->GetDefinition("CMAKE_PCH_EXTENSION"); cmValue pchExtension = this->Makefile->GetDefinition("CMAKE_PCH_EXTENSION");
cmMakefileTargetGeneratorObjectStrings helper( cmMakefileTargetGeneratorObjectStrings helper(
objStrings, this->LocalGenerator, objStrings, this->LocalGenerator, useWatcomQuote,
this->LocalGenerator->GetStateSnapshot().GetDirectory(), limit); this->LocalGenerator->GetStateSnapshot().GetDirectory(), limit);
for (std::string const& obj : this->Objects) { for (std::string const& obj : this->Objects) {
if (cmHasSuffix(obj, pchExtension)) { if (cmHasSuffix(obj, pchExtension)) {
@ -2259,7 +2263,8 @@ void cmMakefileTargetGenerator::CreateObjectLists(
// Construct the individual object list strings. // Construct the individual object list strings.
std::vector<std::string> object_strings; std::vector<std::string> object_strings;
this->WriteObjectsStrings(object_strings, responseFileLimit); this->WriteObjectsStrings(object_strings, useWatcomQuote,
responseFileLimit);
// Lookup the response file reference flag. // Lookup the response file reference flag.
std::string responseFlag = this->GetResponseFlag(responseMode); std::string responseFlag = this->GetResponseFlag(responseMode);
@ -2289,7 +2294,7 @@ void cmMakefileTargetGenerator::CreateObjectLists(
} else if (useLinkScript) { } else if (useLinkScript) {
if (!useArchiveRules) { if (!useArchiveRules) {
std::vector<std::string> objStrings; std::vector<std::string> objStrings;
this->WriteObjectsStrings(objStrings); this->WriteObjectsStrings(objStrings, useWatcomQuote);
buildObjs = objStrings[0]; buildObjs = objStrings[0];
} }
} else { } else {

View File

@ -123,6 +123,7 @@ protected:
std::string& variableNameExternal, std::string& variableNameExternal,
bool useWatcomQuote); bool useWatcomQuote);
void WriteObjectsStrings(std::vector<std::string>& objStrings, void WriteObjectsStrings(std::vector<std::string>& objStrings,
bool useWatcomQuote,
std::string::size_type limit = std::string::npos); std::string::size_type limit = std::string::npos);
// write the driver rule to build target outputs // write the driver rule to build target outputs