summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkDepends.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-03-31 16:47:31 (GMT)
committerBrad King <brad.king@kitware.com>2008-03-31 16:47:31 (GMT)
commit3652a8e913eab6befcbdc74cbd985763ed27db33 (patch)
tree6d65bb6736f40617112f3d38fb78c9fa4fae11b7 /Source/cmComputeLinkDepends.cxx
parent8605551920bd0a904c146173d46fafbc2bba0b2b (diff)
downloadCMake-3652a8e913eab6befcbdc74cbd985763ed27db33.zip
CMake-3652a8e913eab6befcbdc74cbd985763ed27db33.tar.gz
CMake-3652a8e913eab6befcbdc74cbd985763ed27db33.tar.bz2
BUG: Fix bug 6605 more completely
- CMake 2.4 added link directories for targets linked in the optimized configuration even when building debug - Old behavior for policy CMP0003 must account for this
Diffstat (limited to 'Source/cmComputeLinkDepends.cxx')
-rw-r--r--Source/cmComputeLinkDepends.cxx37
1 files changed, 37 insertions, 0 deletions
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index 5005e96..e232525 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -169,6 +169,9 @@ cmComputeLinkDepends
// Enable debug mode if requested.
this->DebugMode = this->Makefile->IsOn("CMAKE_LINK_DEPENDS_DEBUG_MODE");
+
+ // Assume no compatibility until set.
+ this->OldLinkDirMode = false;
}
//----------------------------------------------------------------------------
@@ -183,6 +186,12 @@ cmComputeLinkDepends::~cmComputeLinkDepends()
}
//----------------------------------------------------------------------------
+void cmComputeLinkDepends::SetOldLinkDirMode(bool b)
+{
+ this->OldLinkDirMode = b;
+}
+
+//----------------------------------------------------------------------------
std::vector<cmComputeLinkDepends::LinkEntry> const&
cmComputeLinkDepends::Compute()
{
@@ -460,6 +469,10 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index,
{
actual_libs.push_back(*di);
}
+ else if(this->OldLinkDirMode)
+ {
+ this->CheckWrongConfigItem(*di);
+ }
// Reset the link type until another explicit type is given.
llt = cmTarget::GENERAL;
@@ -492,6 +505,10 @@ cmComputeLinkDepends::AddTargetLinkEntries(int depender_index,
{
actual_libs.push_back(li->first);
}
+ else if(this->OldLinkDirMode)
+ {
+ this->CheckWrongConfigItem(li->first);
+ }
}
// Add these entries.
@@ -809,3 +826,23 @@ void cmComputeLinkDepends::DisplayFinalEntries()
}
fprintf(stderr, "\n");
}
+
+//----------------------------------------------------------------------------
+void cmComputeLinkDepends::CheckWrongConfigItem(std::string const& item)
+{
+ if(!this->OldLinkDirMode)
+ {
+ return;
+ }
+
+ // For CMake 2.4 bug-compatibility we need to consider the output
+ // directories of targets linked in another configuration as link
+ // directories.
+ if(cmTarget* tgt = this->Makefile->FindTargetToUse(item.c_str()))
+ {
+ if(!tgt->IsImported())
+ {
+ this->OldWrongConfigItems.insert(tgt);
+ }
+ }
+}