summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-10-08 10:21:36 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-10-10 18:38:54 (GMT)
commit69295812065a5d07c07347add2fdcf8f36f993ba (patch)
treebbbc09283580c75e2305be1024b6202da2ea423a /Source
parent5b361fdda0f2808f0368b746a880981ebda0ade0 (diff)
downloadCMake-69295812065a5d07c07347add2fdcf8f36f993ba.zip
CMake-69295812065a5d07c07347add2fdcf8f36f993ba.tar.gz
CMake-69295812065a5d07c07347add2fdcf8f36f993ba.tar.bz2
Makefiles: Port CreateLinkLibs to cmLinkLineComputer
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx8
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx9
-rw-r--r--Source/cmMakefileTargetGenerator.cxx12
-rw-r--r--Source/cmMakefileTargetGenerator.h4
4 files changed, 20 insertions, 13 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 3dc7007..09967ff 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -303,10 +303,14 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
// Set path conversion for link script shells.
this->LocalGenerator->SetLinkScriptShell(useLinkScript);
+ CM_AUTO_PTR<cmLinkLineComputer> linkLineComputer(
+ this->CreateLinkLineComputer(
+ this->LocalGenerator->GetStateSnapshot().GetDirectory()));
+
// Collect up flags to link in needed libraries.
std::string linkLibs;
- this->CreateLinkLibs(linkLibs, relink, useResponseFileForLibs, depends,
- useWatcomQuote);
+ this->CreateLinkLibs(linkLineComputer.get(), linkLibs, relink,
+ useResponseFileForLibs, depends, useWatcomQuote);
// Construct object file lists that may be needed to expand the
// rule.
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index b12e779..e32f3a7 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -502,8 +502,13 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
// Collect up flags to link in needed libraries.
std::string linkLibs;
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
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 7232248..d507326 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1599,18 +1599,14 @@ cmLinkLineComputer* cmMakefileTargetGenerator::CreateLinkLineComputer(
}
void cmMakefileTargetGenerator::CreateLinkLibs(
- std::string& linkLibs, bool relink, bool useResponseFile,
- std::vector<std::string>& makefile_depends, bool useWatcomQuote)
+ cmLinkLineComputer* linkLineComputer, std::string& linkLibs, bool relink,
+ bool useResponseFile, std::vector<std::string>& makefile_depends,
+ bool useWatcomQuote)
{
std::string frameworkPath;
std::string linkPath;
-
- CM_AUTO_PTR<cmLinkLineComputer> linkLineComputer(
- this->CreateLinkLineComputer(
- this->LocalGenerator->GetStateSnapshot().GetDirectory()));
-
this->LocalGenerator->OutputLinkLibraries(
- linkLineComputer.get(), linkLibs, frameworkPath, linkPath,
+ linkLineComputer, linkLibs, frameworkPath, linkPath,
*this->GeneratorTarget, relink, useResponseFile, useWatcomQuote);
linkLibs = frameworkPath + linkPath + linkLibs;
diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h
index 733a2f8..05de7ff 100644
--- a/Source/cmMakefileTargetGenerator.h
+++ b/Source/cmMakefileTargetGenerator.h
@@ -20,6 +20,7 @@ class cmGeneratedFileStream;
class cmGeneratorTarget;
class cmGlobalUnixMakefileGenerator3;
class cmSourceFile;
+class cmLinkLineComputer;
/** \class cmMakefileTargetGenerator
* \brief Support Routines for writing makefiles
@@ -151,7 +152,8 @@ protected:
bool CheckUseResponseFileForLibraries(std::string const& l) const;
/** 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,
bool useWatcomQuote);