summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-10-26 12:25:36 (GMT)
committerBrad King <brad.king@kitware.com>2012-10-26 12:28:16 (GMT)
commited9763136acdb8594e4b85ab7b2e4e2828d8b775 (patch)
tree4550665b1317c9a5c314fc5270344cf37747098b /Source/cmComputeLinkInformation.cxx
parent259cff94ff81f7b95b7375905fe0e0a292f70dda (diff)
downloadCMake-ed9763136acdb8594e4b85ab7b2e4e2828d8b775.zip
CMake-ed9763136acdb8594e4b85ab7b2e4e2828d8b775.tar.gz
CMake-ed9763136acdb8594e4b85ab7b2e4e2828d8b775.tar.bz2
Optionally skip link dependencies on shared library files
Add target property LINK_DEPENDS_NO_SHARED and initialization variable CMAKE_LINK_DEPENDS_NO_SHARED to enable this behavior. Suggested-by: Leif Walsh <leif.walsh@gmail.com>
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r--Source/cmComputeLinkInformation.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index cd3ef59..d8ffb5e 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -277,6 +277,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.
@@ -650,7 +654,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);