diff options
author | Brad King <brad.king@kitware.com> | 2013-02-14 15:17:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-02-14 15:18:31 (GMT) |
commit | 95a9c80cacea50e2b5d52d67d0a7f5c9b50192dd (patch) | |
tree | 05d5e8dfb1b303549ba5f3570eb6ec903e95c97f /Source/cmComputeLinkInformation.cxx | |
parent | baa33acbdaa3bf88fe1fc591562574ab43b056fe (diff) | |
parent | 765386279815f208c5f83b1ad2b66776e990feb9 (diff) | |
download | CMake-95a9c80cacea50e2b5d52d67d0a7f5c9b50192dd.zip CMake-95a9c80cacea50e2b5d52d67d0a7f5c9b50192dd.tar.gz CMake-95a9c80cacea50e2b5d52d67d0a7f5c9b50192dd.tar.bz2 |
Merge topic 'LINK_LIBRARIES-property' into rpath-use-implicit-link-dirs
Resolve a logical conflict in the signature of cmTarget::GetLinkClosure.
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index ee8bd90..994783f 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -239,10 +239,12 @@ because this need be done only for shared libraries without soname-s. //---------------------------------------------------------------------------- cmComputeLinkInformation -::cmComputeLinkInformation(cmTarget* target, const char* config) +::cmComputeLinkInformation(cmTarget* target, const char* config, + cmTarget *headTarget) { // Store context information. this->Target = target; + this->HeadTarget = headTarget; this->Makefile = this->Target->GetMakefile(); this->LocalGenerator = this->Makefile->GetLocalGenerator(); this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator(); @@ -265,7 +267,7 @@ cmComputeLinkInformation this->OrderDependentRPath = 0; // Get the language used for linking this target. - this->LinkLanguage = this->Target->GetLinkerLanguage(config); + this->LinkLanguage = this->Target->GetLinkerLanguage(config, headTarget); if(!this->LinkLanguage) { // The Compute method will do nothing, so skip the rest of the @@ -277,6 +279,10 @@ cmComputeLinkInformation this->UseImportLibrary = this->Makefile->GetDefinition("CMAKE_IMPORT_LIBRARY_SUFFIX")?true:false; + // Check whether we should skip dependencies on shared library files. + this->LinkDependsNoShared = + this->Target->GetPropertyAsBool("LINK_DEPENDS_NO_SHARED"); + // On platforms without import libraries there may be a special flag // to use when creating a plugin (module) that obtains symbols from // the program that will load it. @@ -499,7 +505,7 @@ bool cmComputeLinkInformation::Compute() } // Compute the ordered link line items. - cmComputeLinkDepends cld(this->Target, this->Config); + cmComputeLinkDepends cld(this->Target, this->Config, this->HeadTarget); cld.SetOldLinkDirMode(this->OldLinkDirMode); cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute(); @@ -565,7 +571,8 @@ bool cmComputeLinkInformation::Compute() void cmComputeLinkInformation::AddImplicitLinkInfo() { // The link closure lists all languages whose implicit info is needed. - cmTarget::LinkClosure const* lc=this->Target->GetLinkClosure(this->Config); + cmTarget::LinkClosure const* lc=this->Target->GetLinkClosure(this->Config, + this->HeadTarget); for(std::vector<std::string>::const_iterator li = lc->Languages.begin(); li != lc->Languages.end(); ++li) { @@ -650,7 +657,11 @@ void cmComputeLinkInformation::AddItem(std::string const& item, cmTarget* tgt) // Pass the full path to the target file. std::string lib = tgt->GetFullPath(config, implib, true); - this->Depends.push_back(lib); + if(!this->LinkDependsNoShared || + tgt->GetType() != cmTarget::SHARED_LIBRARY) + { + this->Depends.push_back(lib); + } this->AddTargetItem(lib, tgt); this->AddLibraryRuntimeInfo(lib, tgt); @@ -1836,7 +1847,7 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs, // present. This is done even when skipping rpath support. { cmTarget::LinkClosure const* lc = - this->Target->GetLinkClosure(this->Config); + this->Target->GetLinkClosure(this->Config, this->HeadTarget); for(std::vector<std::string>::const_iterator li = lc->Languages.begin(); li != lc->Languages.end(); ++li) { |