[Cmake-commits] [cmake-commits] king committed cmComputeTargetDepends.cxx 1.4 1.5 cmComputeTargetDepends.h 1.3 1.4 cmake.cxx 1.419 1.420

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Aug 24 09:54:32 EDT 2009


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

Modified Files:
	cmComputeTargetDepends.cxx cmComputeTargetDepends.h cmake.cxx 
Log Message:
Create GLOBAL_DEPENDS_NO_CYCLES property

This global property disallows cycles in the inter-target dependency
graph even among STATIC libraries.  See issue #9444.


Index: cmComputeTargetDepends.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeTargetDepends.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -C 2 -d -r1.4 -r1.5
*** cmComputeTargetDepends.cxx	6 Aug 2008 21:48:53 -0000	1.4
--- cmComputeTargetDepends.cxx	24 Aug 2009 13:54:26 -0000	1.5
***************
*** 104,107 ****
--- 104,108 ----
    cmake* cm = this->GlobalGenerator->GetCMakeInstance();
    this->DebugMode = cm->GetPropertyAsBool("GLOBAL_DEPENDS_DEBUG_MODE");
+   this->NoCycles = cm->GetPropertyAsBool("GLOBAL_DEPENDS_NO_CYCLES");
  }
  
***************
*** 345,348 ****
--- 346,356 ----
        }
  
+     // Immediately complain if no cycles are allowed at all.
+     if(this->NoCycles)
+       {
+       this->ComplainAboutBadComponent(ccg, c);
+       return false;
+       }
+ 
      // Make sure the component is all STATIC_LIBRARY targets.
      for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni)
***************
*** 392,397 ****
        }
      }
!   e << "At least one of these targets is not a STATIC_LIBRARY.  "
!     << "Cyclic dependencies are allowed only among static libraries.";
    cmSystemTools::Error(e.str().c_str());
  }
--- 400,413 ----
        }
      }
!   if(this->NoCycles)
!     {
!     e << "The GLOBAL_DEPENDS_NO_CYCLES global property is enabled, so "
!       << "cyclic dependencies are not allowed even among static libraries.";
!     }
!   else
!     {
!     e << "At least one of these targets is not a STATIC_LIBRARY.  "
!       << "Cyclic dependencies are allowed only among static libraries.";
!     }
    cmSystemTools::Error(e.str().c_str());
  }

Index: cmComputeTargetDepends.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmComputeTargetDepends.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C 2 -d -r1.3 -r1.4
*** cmComputeTargetDepends.h	6 Aug 2008 21:48:53 -0000	1.3
--- cmComputeTargetDepends.h	24 Aug 2009 13:54:27 -0000	1.4
***************
*** 55,58 ****
--- 55,59 ----
    cmGlobalGenerator* GlobalGenerator;
    bool DebugMode;
+   bool NoCycles;
  
    // Collect all targets.

Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.419
retrieving revision 1.420
diff -C 2 -d -r1.419 -r1.420
*** cmake.cxx	31 Jul 2009 20:11:28 -0000	1.419
--- cmake.cxx	24 Aug 2009 13:54:27 -0000	1.420
***************
*** 3416,3419 ****
--- 3416,3429 ----
  
    cm->DefineProperty(
+     "GLOBAL_DEPENDS_NO_CYCLES", cmProperty::GLOBAL,
+     "Disallow global target dependency graph cycles.",
+     "CMake automatically analyzes the global inter-target dependency graph "
+     "at the beginning of native build system generation.  "
+     "It reports an error if the dependency graph contains a cycle that "
+     "does not consist of all STATIC library targets.  "
+     "This property tells CMake to disallow all cycles completely, even "
+     "among static libraries.");
+ 
+   cm->DefineProperty(
      "ALLOW_DUPLICATE_CUSTOM_TARGETS", cmProperty::GLOBAL,
      "Allow duplicate custom targets to be created.",



More information about the Cmake-commits mailing list