summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-05-21 23:57:35 (GMT)
committerBrad King <brad.king@kitware.com>2008-05-21 23:57:35 (GMT)
commit23a60d561cc322e6b12feab27cb1614c3fcb779c (patch)
tree417752e05c4fe35b57450015a6388ae325e19e80 /Source/cmMakefileTargetGenerator.cxx
parent40d06f542c9813f8cf96a91ba3b90ce0d0945bcb (diff)
downloadCMake-23a60d561cc322e6b12feab27cb1614c3fcb779c.zip
CMake-23a60d561cc322e6b12feab27cb1614c3fcb779c.tar.gz
CMake-23a60d561cc322e6b12feab27cb1614c3fcb779c.tar.bz2
BUG: Fix makefile generator to have link rules depend on all full path libraries that appear on the link line. This allows projects to relink when imported targets have changed.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx45
1 files changed, 7 insertions, 38 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 05efc77..5e724d4 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -24,6 +24,7 @@
#include "cmSourceFile.h"
#include "cmTarget.h"
#include "cmake.h"
+#include "cmComputeLinkInformation.h"
#include "cmMakefileExecutableTargetGenerator.h"
#include "cmMakefileLibraryTargetGenerator.h"
@@ -1463,48 +1464,16 @@ void cmMakefileTargetGenerator
{
return;
}
- // Compute which library configuration to link.
- cmTarget::LinkLibraryType linkType = cmTarget::OPTIMIZED;
- if(cmSystemTools::UpperCase(
- this->LocalGenerator->ConfigurationName.c_str()) == "DEBUG")
- {
- linkType = cmTarget::DEBUG;
- }
- // Keep track of dependencies already listed.
- std::set<cmStdString> emitted;
-
- // A target should not depend on itself.
- emitted.insert(this->Target->GetName());
// Loop over all library dependencies.
- const cmTarget::LinkLibraryVectorType& tlibs =
- this->Target->GetLinkLibraries();
- for(cmTarget::LinkLibraryVectorType::const_iterator lib = tlibs.begin();
- lib != tlibs.end(); ++lib)
+ const char* cfg = this->LocalGenerator->ConfigurationName.c_str();
+ if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
{
- // skip the library if it is not general and the link type
- // does not match the current target
- if(lib->second != cmTarget::GENERAL &&
- lib->second != linkType)
+ std::vector<std::string> const& libDeps = cli->GetDepends();
+ for(std::vector<std::string>::const_iterator j = libDeps.begin();
+ j != libDeps.end(); ++j)
{
- continue;
- }
-
- // Don't emit the same library twice for this target.
- if(emitted.insert(lib->first).second)
- {
- // Depend on other CMake targets.
- if(cmTarget* tgt =
- this->GlobalGenerator->FindTarget(0, lib->first.c_str()))
- {
- const char* config = this->LocalGenerator->ConfigurationName.c_str();
- depends.push_back(tgt->GetFullPath(config, false));
- }
- // depend on full path libs as well
- else if(cmSystemTools::FileIsFullPath(lib->first.c_str()))
- {
- depends.push_back(lib->first.c_str());
- }
+ depends.push_back(*j);
}
}
}