An update will be applied January 25th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

Commit 69295812 authored by Stephen Kelly's avatar Stephen Kelly
Browse files

Makefiles: Port CreateLinkLibs to cmLinkLineComputer

parent 5b361fdd
Pipeline #30061 passed with stage
...@@ -303,10 +303,14 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) ...@@ -303,10 +303,14 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
// Set path conversion for link script shells. // Set path conversion for link script shells.
this->LocalGenerator->SetLinkScriptShell(useLinkScript); this->LocalGenerator->SetLinkScriptShell(useLinkScript);
CM_AUTO_PTR<cmLinkLineComputer> linkLineComputer(
this->CreateLinkLineComputer(
this->LocalGenerator->GetStateSnapshot().GetDirectory()));
// Collect up flags to link in needed libraries. // Collect up flags to link in needed libraries.
std::string linkLibs; std::string linkLibs;
this->CreateLinkLibs(linkLibs, relink, useResponseFileForLibs, depends, this->CreateLinkLibs(linkLineComputer.get(), linkLibs, relink,
useWatcomQuote); useResponseFileForLibs, depends, useWatcomQuote);
// Construct object file lists that may be needed to expand the // Construct object file lists that may be needed to expand the
// rule. // rule.
......
...@@ -502,8 +502,13 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( ...@@ -502,8 +502,13 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
// Collect up flags to link in needed libraries. // Collect up flags to link in needed libraries.
std::string linkLibs; std::string linkLibs;
if (this->GeneratorTarget->GetType() != cmState::STATIC_LIBRARY) { if (this->GeneratorTarget->GetType() != cmState::STATIC_LIBRARY) {
this->CreateLinkLibs(linkLibs, relink, useResponseFileForLibs, depends,
useWatcomQuote); CM_AUTO_PTR<cmLinkLineComputer> linkLineComputer(
this->CreateLinkLineComputer(
this->LocalGenerator->GetStateSnapshot().GetDirectory()));
this->CreateLinkLibs(linkLineComputer.get(), linkLibs, relink,
useResponseFileForLibs, depends, useWatcomQuote);
} }
// Construct object file lists that may be needed to expand the // Construct object file lists that may be needed to expand the
......
...@@ -1599,18 +1599,14 @@ cmLinkLineComputer* cmMakefileTargetGenerator::CreateLinkLineComputer( ...@@ -1599,18 +1599,14 @@ cmLinkLineComputer* cmMakefileTargetGenerator::CreateLinkLineComputer(
} }
void cmMakefileTargetGenerator::CreateLinkLibs( void cmMakefileTargetGenerator::CreateLinkLibs(
std::string& linkLibs, bool relink, bool useResponseFile, cmLinkLineComputer* linkLineComputer, std::string& linkLibs, bool relink,
std::vector<std::string>& makefile_depends, bool useWatcomQuote) bool useResponseFile, std::vector<std::string>& makefile_depends,
bool useWatcomQuote)
{ {
std::string frameworkPath; std::string frameworkPath;
std::string linkPath; std::string linkPath;
CM_AUTO_PTR<cmLinkLineComputer> linkLineComputer(
this->CreateLinkLineComputer(
this->LocalGenerator->GetStateSnapshot().GetDirectory()));
this->LocalGenerator->OutputLinkLibraries( this->LocalGenerator->OutputLinkLibraries(
linkLineComputer.get(), linkLibs, frameworkPath, linkPath, linkLineComputer, linkLibs, frameworkPath, linkPath,
*this->GeneratorTarget, relink, useResponseFile, useWatcomQuote); *this->GeneratorTarget, relink, useResponseFile, useWatcomQuote);
linkLibs = frameworkPath + linkPath + linkLibs; linkLibs = frameworkPath + linkPath + linkLibs;
......
...@@ -20,6 +20,7 @@ class cmGeneratedFileStream; ...@@ -20,6 +20,7 @@ class cmGeneratedFileStream;
class cmGeneratorTarget; class cmGeneratorTarget;
class cmGlobalUnixMakefileGenerator3; class cmGlobalUnixMakefileGenerator3;
class cmSourceFile; class cmSourceFile;
class cmLinkLineComputer;
/** \class cmMakefileTargetGenerator /** \class cmMakefileTargetGenerator
* \brief Support Routines for writing makefiles * \brief Support Routines for writing makefiles
...@@ -151,7 +152,8 @@ protected: ...@@ -151,7 +152,8 @@ protected:
bool CheckUseResponseFileForLibraries(std::string const& l) const; bool CheckUseResponseFileForLibraries(std::string const& l) const;
/** Create list of flags for link libraries. */ /** Create list of flags for link libraries. */
void CreateLinkLibs(std::string& linkLibs, bool relink, bool useResponseFile, void CreateLinkLibs(cmLinkLineComputer* linkLineComputer,
std::string& linkLibs, bool relink, bool useResponseFile,
std::vector<std::string>& makefile_depends, std::vector<std::string>& makefile_depends,
bool useWatcomQuote); bool useWatcomQuote);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment