From 7a907f87f8a7ec08f8d402dd2fafd2a189e81bbc Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 14 Jul 2009 10:14:52 -0400 Subject: STYLE: Factor cmComputeLinkInformation constructor This factors some code out of the constructor into a new method cmComputeLinkInformation::LoadImplicitLinkInfo for readability. --- Source/cmComputeLinkInformation.cxx | 39 +++++++++++++++++++++++-------------- Source/cmComputeLinkInformation.h | 1 + 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 66d355d..a824fe4 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -365,26 +365,14 @@ cmComputeLinkInformation "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 implicitLinkVec; - cmSystemTools::ExpandListArgument(implicitLinks, implicitLinkVec); - for(std::vector::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. this->OrderLinkerSearchPath ->AddUserDirectories(this->Target->GetLinkDirectories()); this->OrderRuntimeSearchPath ->AddUserDirectories(this->Target->GetLinkDirectories()); + + // Set up the implicit link directories. + this->LoadImplicitLinkInfo(); this->OrderLinkerSearchPath ->SetImplicitDirectories(this->ImplicitLinkDirs); this->OrderRuntimeSearchPath @@ -1551,6 +1539,27 @@ void cmComputeLinkInformation::PrintLinkPolicyDiagnosis(std::ostream& os) } //---------------------------------------------------------------------------- +void cmComputeLinkInformation::LoadImplicitLinkInfo() +{ + std::vector 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::const_iterator i = implicitDirVec.begin(); + i != implicitDirVec.end(); ++i) + { + this->ImplicitLinkDirs.insert(*i); + } +} + +//---------------------------------------------------------------------------- std::vector const& cmComputeLinkInformation::GetRuntimeSearchPath() { diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index 147b8ff..d7821c6 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -160,6 +160,7 @@ private: cmOrderDirectories* OrderLinkerSearchPath; bool FinishLinkerSearchDirectories(); void PrintLinkPolicyDiagnosis(std::ostream&); + void LoadImplicitLinkInfo(); std::set ImplicitLinkDirs; // Linker search path compatibility mode. -- cgit v0.12