[Cmake-commits] [cmake-commits] king committed cmMakefileTargetGenerator.cxx 1.100 1.101
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed May 21 19:57:37 EDT 2008
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv16703/Source
Modified Files:
cmMakefileTargetGenerator.cxx
Log Message:
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.
Index: cmMakefileTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileTargetGenerator.cxx,v
retrieving revision 1.100
retrieving revision 1.101
diff -C 2 -d -r1.100 -r1.101
*** cmMakefileTargetGenerator.cxx 14 May 2008 15:38:46 -0000 1.100
--- cmMakefileTargetGenerator.cxx 21 May 2008 23:57:35 -0000 1.101
***************
*** 25,28 ****
--- 25,29 ----
#include "cmTarget.h"
#include "cmake.h"
+ #include "cmComputeLinkInformation.h"
#include "cmMakefileExecutableTargetGenerator.h"
***************
*** 1464,1509 ****
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)
{
! // 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)
! {
! 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());
! }
}
}
--- 1465,1478 ----
return;
}
// Loop over all library dependencies.
! const char* cfg = this->LocalGenerator->ConfigurationName.c_str();
! if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
{
! std::vector<std::string> const& libDeps = cli->GetDepends();
! for(std::vector<std::string>::const_iterator j = libDeps.begin();
! j != libDeps.end(); ++j)
{
! depends.push_back(*j);
}
}
More information about the Cmake-commits
mailing list