summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-09-15 13:51:47 (GMT)
committerBrad King <brad.king@kitware.com>2008-09-15 13:51:47 (GMT)
commit76c5697a16245450af9ae7e510cb1a66cce1ab94 (patch)
treec1a198a4c378c9ada506e73731ea2fa29cd11f57 /Source
parenta4d679af905d627782f77f2b7771a5bef7da4f63 (diff)
downloadCMake-76c5697a16245450af9ae7e510cb1a66cce1ab94.zip
CMake-76c5697a16245450af9ae7e510cb1a66cce1ab94.tar.gz
CMake-76c5697a16245450af9ae7e510cb1a66cce1ab94.tar.bz2
ENH: Use improved target dependencies for Xcode
In cmGlobalGenerator we use cmComputeTargetDepends to construct a safe, non-circular set of inter-target dependencies. This change enables use of the results by the Xcode generator. It also removes a lot of old code and another use of the old-style linking logic. See issue #7652.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx66
1 files changed, 4 insertions, 62 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index b045ffd..b817728 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2047,72 +2047,14 @@ void cmGlobalXCodeGenerator
}
// Add dependencies on other CMake targets.
- {
- // Keep track of dependencies already listed.
- std::set<cmStdString> emitted;
-
- // A target should not depend on itself.
- emitted.insert(cmtarget->GetName());
-
- // Loop over all library dependencies.
- const cmTarget::LinkLibraryVectorType& tlibs =
- cmtarget->GetLinkLibraries();
- for(cmTarget::LinkLibraryVectorType::const_iterator lib = tlibs.begin();
- lib != tlibs.end(); ++lib)
+ TargetDependSet const& deps = this->GetTargetDirectDepends(*cmtarget);
+ for(TargetDependSet::const_iterator i = deps.begin(); i != deps.end(); ++i)
{
- // Don't emit the same library twice for this target.
- if(emitted.insert(lib->first).second)
+ if(cmXCodeObject* dptarget = this->FindXCodeTarget(*i))
{
- // Add this dependency.
- cmTarget* t = this->FindTarget(this->CurrentProject.c_str(),
- lib->first.c_str());
- cmXCodeObject* dptarget = this->FindXCodeTarget(t);
- if(dptarget)
- {
- this->AddDependTarget(target, dptarget);
- }
+ this->AddDependTarget(target, dptarget);
}
}
- }
-
- // write utility dependencies.
- for(std::set<cmStdString>::const_iterator i
- = cmtarget->GetUtilities().begin();
- i != cmtarget->GetUtilities().end(); ++i)
- {
- cmTarget* t = this->FindTarget(this->CurrentProject.c_str(),
- i->c_str());
- // if the target is in this project then make target depend
- // on it. It may not be in this project if this is a sub
- // project from the top.
- if(t)
- {
- cmXCodeObject* dptarget = this->FindXCodeTarget(t);
- if(dptarget)
- {
- this->AddDependTarget(target, dptarget);
- }
- else
- {
- std::string m = "Error Utility: ";
- m += i->c_str();
- m += "\n";
- m += "cmtarget ";
- if(t)
- {
- m += t->GetName();
- }
- m += "\n";
- m += "Is on the target ";
- m += cmtarget->GetName();
- m += "\n";
- m += "But it has no xcode target created yet??\n";
- m += "Current project is ";
- m += this->CurrentProject.c_str();
- cmSystemTools::Error(m.c_str());
- }
- }
- }
// Skip link information for static libraries.
if(cmtarget->GetType() == cmTarget::STATIC_LIBRARY)