STYLE: Factor cmComputeLinkInformation constructor
This factors some code out of the constructor into a new method cmComputeLinkInformation::LoadImplicitLinkInfo for readability.
This commit is contained in:
parent
d60608c858
commit
7a907f87f8
|
@ -365,26 +365,14 @@ cmComputeLinkInformation
|
||||||
"dependent library path");
|
"dependent library path");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the implicit link directories for this platform.
|
|
||||||
if(const char* implicitLinks =
|
|
||||||
(this->Makefile->GetDefinition
|
|
||||||
("CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES")))
|
|
||||||
{
|
|
||||||
std::vector<std::string> implicitLinkVec;
|
|
||||||
cmSystemTools::ExpandListArgument(implicitLinks, implicitLinkVec);
|
|
||||||
for(std::vector<std::string>::const_iterator
|
|
||||||
i = implicitLinkVec.begin();
|
|
||||||
i != implicitLinkVec.end(); ++i)
|
|
||||||
{
|
|
||||||
this->ImplicitLinkDirs.insert(*i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the search path entries requested by the user to path ordering.
|
// Add the search path entries requested by the user to path ordering.
|
||||||
this->OrderLinkerSearchPath
|
this->OrderLinkerSearchPath
|
||||||
->AddUserDirectories(this->Target->GetLinkDirectories());
|
->AddUserDirectories(this->Target->GetLinkDirectories());
|
||||||
this->OrderRuntimeSearchPath
|
this->OrderRuntimeSearchPath
|
||||||
->AddUserDirectories(this->Target->GetLinkDirectories());
|
->AddUserDirectories(this->Target->GetLinkDirectories());
|
||||||
|
|
||||||
|
// Set up the implicit link directories.
|
||||||
|
this->LoadImplicitLinkInfo();
|
||||||
this->OrderLinkerSearchPath
|
this->OrderLinkerSearchPath
|
||||||
->SetImplicitDirectories(this->ImplicitLinkDirs);
|
->SetImplicitDirectories(this->ImplicitLinkDirs);
|
||||||
this->OrderRuntimeSearchPath
|
this->OrderRuntimeSearchPath
|
||||||
|
@ -1550,6 +1538,27 @@ void cmComputeLinkInformation::PrintLinkPolicyDiagnosis(std::ostream& os)
|
||||||
<< "Run \"cmake --help-policy CMP0003\" for more information.";
|
<< "Run \"cmake --help-policy CMP0003\" for more information.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
void cmComputeLinkInformation::LoadImplicitLinkInfo()
|
||||||
|
{
|
||||||
|
std::vector<std::string> implicitDirVec;
|
||||||
|
|
||||||
|
// Get platform-wide implicit directories.
|
||||||
|
if(const char* implicitLinks =
|
||||||
|
(this->Makefile->GetDefinition
|
||||||
|
("CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES")))
|
||||||
|
{
|
||||||
|
cmSystemTools::ExpandListArgument(implicitLinks, implicitDirVec);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Store implicit link directories.
|
||||||
|
for(std::vector<std::string>::const_iterator i = implicitDirVec.begin();
|
||||||
|
i != implicitDirVec.end(); ++i)
|
||||||
|
{
|
||||||
|
this->ImplicitLinkDirs.insert(*i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
std::vector<std::string> const&
|
std::vector<std::string> const&
|
||||||
cmComputeLinkInformation::GetRuntimeSearchPath()
|
cmComputeLinkInformation::GetRuntimeSearchPath()
|
||||||
|
|
|
@ -160,6 +160,7 @@ private:
|
||||||
cmOrderDirectories* OrderLinkerSearchPath;
|
cmOrderDirectories* OrderLinkerSearchPath;
|
||||||
bool FinishLinkerSearchDirectories();
|
bool FinishLinkerSearchDirectories();
|
||||||
void PrintLinkPolicyDiagnosis(std::ostream&);
|
void PrintLinkPolicyDiagnosis(std::ostream&);
|
||||||
|
void LoadImplicitLinkInfo();
|
||||||
std::set<cmStdString> ImplicitLinkDirs;
|
std::set<cmStdString> ImplicitLinkDirs;
|
||||||
|
|
||||||
// Linker search path compatibility mode.
|
// Linker search path compatibility mode.
|
||||||
|
|
Loading…
Reference in New Issue