summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-12-21 20:04:06 (GMT)
committerBrad King <brad.king@kitware.com>2007-12-21 20:04:06 (GMT)
commit3cf3bb664aa9b6c447c90c33cd6b5c1dff8c1a10 (patch)
treea392ebf61b0938354d5a73979a452102ff5eef7c /Source/cmGlobalXCodeGenerator.cxx
parentd2be142e3bd2b1347a5bce0c75740b3b2e7acd94 (diff)
downloadCMake-3cf3bb664aa9b6c447c90c33cd6b5c1dff8c1a10.zip
CMake-3cf3bb664aa9b6c447c90c33cd6b5c1dff8c1a10.tar.gz
CMake-3cf3bb664aa9b6c447c90c33cd6b5c1dff8c1a10.tar.bz2
ENH: Make static library targets depend on targets to which they "link" for the purpose of build ordering. This makes the build order consistent for static and shared library builds. It is also useful when custom command inputs of one library are generated as custom commands outputs of another. It may be useful in the future for Fortran module dependencies. Implemented for Makefiles, Xcode, and VS 8 and above. Added sample code to do it for VS 7.1 and below, but left it disabled with comments explaining why. Likely it will never be needed on VS 7.1 or below anyway.
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx41
1 files changed, 20 insertions, 21 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index f08c36e..d02fe26 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2006,34 +2006,33 @@ void cmGlobalXCodeGenerator
}
// Add dependencies on other CMake targets.
- if(cmtarget->GetType() != cmTarget::STATIC_LIBRARY)
- {
- // Keep track of dependencies already listed.
- std::set<cmStdString> emitted;
+ {
+ // Keep track of dependencies already listed.
+ std::set<cmStdString> emitted;
- // A target should not depend on itself.
- emitted.insert(cmtarget->GetName());
+ // 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)
+ // Loop over all library dependencies.
+ const cmTarget::LinkLibraryVectorType& tlibs =
+ cmtarget->GetLinkLibraries();
+ for(cmTarget::LinkLibraryVectorType::const_iterator lib = tlibs.begin();
+ lib != tlibs.end(); ++lib)
+ {
+ // Don't emit the same library twice for this target.
+ if(emitted.insert(lib->first).second)
{
- // Don't emit the same library twice for this target.
- if(emitted.insert(lib->first).second)
+ // Add this dependency.
+ cmTarget* t = this->FindTarget(this->CurrentProject.c_str(),
+ lib->first.c_str(), false);
+ cmXCodeObject* dptarget = this->FindXCodeTarget(t);
+ if(dptarget)
{
- // Add this dependency.
- cmTarget* t = this->FindTarget(this->CurrentProject.c_str(),
- lib->first.c_str(), false);
- 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