[Cmake-commits] [cmake-commits] king committed cmGlobalXCodeGenerator.cxx 1.200 1.201

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Sep 15 09:51:49 EDT 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv26644/Source

Modified Files:
	cmGlobalXCodeGenerator.cxx 
Log Message:
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.


Index: cmGlobalXCodeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v
retrieving revision 1.200
retrieving revision 1.201
diff -C 2 -d -r1.200 -r1.201
*** cmGlobalXCodeGenerator.cxx	11 Sep 2008 18:50:38 -0000	1.200
--- cmGlobalXCodeGenerator.cxx	15 Sep 2008 13:51:47 -0000	1.201
***************
*** 2048,2117 ****
  
    // 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)
      {
!     // 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());
!       cmXCodeObject* dptarget = this->FindXCodeTarget(t);
!       if(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.
--- 2048,2059 ----
  
    // Add dependencies on other CMake targets.
!   TargetDependSet const& deps = this->GetTargetDirectDepends(*cmtarget);
!   for(TargetDependSet::const_iterator i = deps.begin(); i != deps.end(); ++i)
      {
!     if(cmXCodeObject* dptarget = this->FindXCodeTarget(*i))
        {
!       this->AddDependTarget(target, dptarget);
        }
      }
  
    // Skip link information for static libraries.



More information about the Cmake-commits mailing list