summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkDepends.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-07-30 13:25:52 (GMT)
committerBrad King <brad.king@kitware.com>2008-07-30 13:25:52 (GMT)
commit96c9e7de7e1e4ef8497ec26afe507904e76ce63c (patch)
tree2802d5594c8e5138f6ba06787c4c9f4876f1cd89 /Source/cmComputeLinkDepends.cxx
parentbd4601f98797535995d44902540690c891f007d3 (diff)
downloadCMake-96c9e7de7e1e4ef8497ec26afe507904e76ce63c.zip
CMake-96c9e7de7e1e4ef8497ec26afe507904e76ce63c.tar.gz
CMake-96c9e7de7e1e4ef8497ec26afe507904e76ce63c.tar.bz2
BUG: Preserve shared lib order for 2.4 compatibility
We preserve the order and multiplicity of libraries directly linked by a target as specified by the user. Items known to be shared libraries may be safely skipped because order preservation is only needed for static libraries. However, CMake 2.4 did not skip shared libs, so we do the same when in 2.4 compatibility mode.
Diffstat (limited to 'Source/cmComputeLinkDepends.cxx')
-rw-r--r--Source/cmComputeLinkDepends.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 305c06d..8d448b8 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -881,6 +881,11 @@ void cmComputeLinkDepends::CheckWrongConfigItem(std::string const& item)
//----------------------------------------------------------------------------
void cmComputeLinkDepends::PreserveOriginalEntries()
{
+ // In CMake 2.4 and below all link items were included in order
+ // preservation. In CMake 2.6 and above we know it is safe to skip
+ // shared libraries.
+ bool skipShared = !this->LocalGenerator->NeedBackwardsCompatibility(2,4);
+
// Regular expression to match shared libraries.
cmsys::RegularExpression shared_lib(this->SharedRegexString.c_str());
@@ -893,7 +898,7 @@ void cmComputeLinkDepends::PreserveOriginalEntries()
{
cmTarget* tgt = this->EntryList[*in].Target;
if((tgt && tgt->GetType() != cmTarget::STATIC_LIBRARY) ||
- (!tgt && shared_lib.find(this->EntryList[*in].Item)))
+ (skipShared && !tgt && shared_lib.find(this->EntryList[*in].Item)))
{
// Skip input items known to not be static libraries.
++in;
@@ -917,7 +922,7 @@ void cmComputeLinkDepends::PreserveOriginalEntries()
{
cmTarget* tgt = this->EntryList[*in].Target;
if((tgt && tgt->GetType() != cmTarget::STATIC_LIBRARY) ||
- (!tgt && shared_lib.find(this->EntryList[*in].Item)))
+ (skipShared && !tgt && shared_lib.find(this->EntryList[*in].Item)))
{
// Skip input items known to not be static libraries.
++in;