CMake/Tests/RunCMake/add_custom_target
Brad King 1296a0eada Ninja: Fix inter-target order-only dependencies of custom commands
Custom command dependencies are followed for each target's source files
and add their transitive closure to the corresponding target.  This
means that when a custom command in one target has a dependency on a
custom command in another target, both will appear in the dependent
target's sources.  For the Makefile, VS IDE, and Xcode generators this
is not a problem because each target gets its own independent build
system that is evaluated in target dependency order.  By the time the
dependent target is built the custom command that belongs to one of its
dependencies will already have been brought up to date.

For the Ninja generator we need to generate a monolithic build system
covering all targets so we can have only one copy of a custom command.
This means that we need to reconcile the target-level ordering
dependencies from its appearance in multiple targets to include only the
least-dependent common set.  This is done by computing the set
intersection of the dependencies of all the targets containing a custom
command.  However, we previously included only the direct dependencies
so any target-level dependency not directly added to all targets into
which a custom command propagates was discarded.

Fix this by computing the transitive closure of dependencies for each
target and then intersecting those sets.  That will get the common set
of dependencies.  Also add a test to cover a case in which the
incorrectly dropped target ordering dependencies would fail.
2016-07-20 13:12:24 -04:00
..
BadTargetName-result.txt Tests: Test add_custom_command and add_custom_target error cases 2014-11-14 11:43:35 -05:00
BadTargetName-stderr.txt Tests: Test add_custom_command and add_custom_target error cases 2014-11-14 11:43:35 -05:00
BadTargetName.cmake Tests: Test add_custom_command and add_custom_target error cases 2014-11-14 11:43:35 -05:00
ByproductsNoCommand-result.txt Add an option for explicit BYPRODUCTS of custom commands (#14963) 2014-11-14 16:16:00 -05:00
ByproductsNoCommand-stderr.txt Add an option for explicit BYPRODUCTS of custom commands (#14963) 2014-11-14 16:16:00 -05:00
ByproductsNoCommand.cmake Add an option for explicit BYPRODUCTS of custom commands (#14963) 2014-11-14 16:16:00 -05:00
CMakeLists.txt Tests: Test add_custom_command and add_custom_target error cases 2014-11-14 11:43:35 -05:00
NoArguments-result.txt Tests: Test add_custom_command and add_custom_target error cases 2014-11-14 11:43:35 -05:00
NoArguments-stderr.txt Tests: Test add_custom_command and add_custom_target error cases 2014-11-14 11:43:35 -05:00
NoArguments.cmake Tests: Test add_custom_command and add_custom_target error cases 2014-11-14 11:43:35 -05:00
RunCMakeTest.cmake Ninja: Fix inter-target order-only dependencies of custom commands 2016-07-20 13:12:24 -04:00
TargetOrder.cmake Ninja: Fix inter-target order-only dependencies of custom commands 2016-07-20 13:12:24 -04:00
UsesTerminalNoCommand-result.txt Add USES_TERMINAL option for custom commands 2014-11-14 11:55:09 -05:00
UsesTerminalNoCommand-stderr.txt Add USES_TERMINAL option for custom commands 2014-11-14 11:55:09 -05:00
UsesTerminalNoCommand.cmake Add USES_TERMINAL option for custom commands 2014-11-14 11:55:09 -05:00