summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-07-14 14:14:52 (GMT)
committerBrad King <brad.king@kitware.com>2009-07-14 14:14:52 (GMT)
commit7a907f87f8a7ec08f8d402dd2fafd2a189e81bbc (patch)
tree3e6be7ddb862955880fc25d875aff8d084aff334
parentd60608c858b5d3f521ee03b86c5d6eb215ff7af0 (diff)
downloadCMake-7a907f87f8a7ec08f8d402dd2fafd2a189e81bbc.zip
CMake-7a907f87f8a7ec08f8d402dd2fafd2a189e81bbc.tar.gz
CMake-7a907f87f8a7ec08f8d402dd2fafd2a189e81bbc.tar.bz2
STYLE: Factor cmComputeLinkInformation constructor
This factors some code out of the constructor into a new method cmComputeLinkInformation::LoadImplicitLinkInfo for readability.
-rw-r--r--Source/cmComputeLinkInformation.cxx39
-rw-r--r--Source/cmComputeLinkInformation.h1
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<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.
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<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&
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<cmStdString> ImplicitLinkDirs;
// Linker search path compatibility mode.