Commit Graph

11 Commits

Author SHA1 Message Date
Brad King e01cce2869 Allow add_dependencies() on imported targets (#10395)
Imported targets do not themselves build, but we can follow dependencies
through them to find real targets.  This allows imported targets to
depend on custom targets that provide the underlying files at build
time.
2010-11-19 17:19:21 -05:00
Brad King 605f4bc097 Record edge type in global dependency graph
Each inter-target dependency may be a 'link' or 'util' dependency.
2010-11-18 10:51:00 -05:00
Brad King adb58d5e36 Honor strong intra-component target dependencies
Strong dependencies (created by add_dependencies) must be honored when
linearizing a strongly-connected component of the target dependency
graph.  The initial graph edges have strong/weak labels and can contain
cycles that do not consist exclusively of strong edges.  The final graph
never contains cycles so all edges can be strong.
2010-08-25 17:14:13 -04:00
Brad King 681cf011dd Distinguish "strong" and "weak" target dependency edges
Utility dependencies are "strong" because they must be enforced to
generate a working build.  Link dependencies are "weak" because they can
be broken in the case of a static library cycle.
2010-08-25 17:10:00 -04:00
Brad King 7be2617b5a Split notion of node lists and edge lists 2010-08-25 17:10:00 -04:00
Brad King 96afb12087 Convert CMake to OSI-approved BSD License
This converts the CMake license to a pure 3-clause OSI-approved BSD
License.  We drop the previous license clause requiring modified
versions to be plainly marked.  We also update the CMake copyright to
cover the full development time range.
2009-09-28 11:43:28 -04:00
Brad King fd62a7cac4 Create GLOBAL_DEPENDS_NO_CYCLES property
This global property disallows cycles in the inter-target dependency
graph even among STATIC libraries.  See issue #9444.
2009-08-24 09:54:27 -04:00
Brad King d76b20bf3a BUG: Avoid bogus dependency on executable targets
When an executable target within the project is named in
target_link_libraries for another target, but the executable does not
have the ENABLE_EXPORTS property set, then the executable cannot really
be linked.  This is probably a case where the user intends to link to a
third-party library that happens to have the same name as an executable
target in the project (or else will get an error at build time).  We
need to avoid making the other target depend on the executable target
incorrectly, since the executable may actually want to link to that
target and this is not a circular depenency.
2008-08-06 17:48:53 -04:00
Brad King 37a009b7f7 ENH: Improve readability of circular depends error
When reporting the dependencies in a strongly connected component quote
the target names to make the message more readable no matter the target
name.
2008-08-06 17:48:49 -04:00
Brad King 4987e17f46 ENH: Improve link line generation for static library cycles.
- Move Tarjan algorithm from cmComputeTargetDepends
    into its own class cmComputeComponentGraph
  - Use cmComputeComponentGraph to identify the component DAG
    of link dependencies in cmComputeLinkDepends
  - Emit non-trivial component members more than once but always
    in a contiguous group on the link line
2008-02-07 16:14:05 -05:00
Brad King 523ddedac5 ENH: Analyze inter-target dependencies to safely fix cycles
- Cycles may be formed among static libraries
  - Native build system should not have cycles in target deps
  - Create cmComputeTargetDepends to analyze dependencies
  - Identify conneced components and use them to fix deps
  - Diagnose cycles containing non-STATIC targets
  - Add debug mode property GLOBAL_DEPENDS_DEBUG_MODE
  - Use results in cmGlobalGenerator as target direct depends
2008-02-05 23:10:41 -05:00