Tests: use BYPRODUCTS in the CustomCommandWorkingDirectory test

This was inadvertently testing the assumed sources behavior in Ninja (no
other test seems to exercise it). There is now a test explicitly testing
it in `RunCMake.Ninja`, so fix this test to work properly regardless of
the assumed sources behavior.
This commit is contained in:
Ben Boeckel
2017-04-18 15:12:32 -04:00
parent 664591ce59
commit d96e5d9a19
2 changed files with 10 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
ninja-loosen-object-deps
------------------------
* The :generator:`Ninja` generator has loosened dependencies on object
compilation to depend on the custom targets and commands of dependent
libraries instead of the libraries themselves. This helps projects with deep
dependency graphs to be blocked only on their link steps at the deeper
levels rather than also blocking object compilation on dependent link steps.

View File

@@ -19,6 +19,7 @@ add_executable(working "${TestWorkingDir_BINARY_DIR}/working.c"
add_custom_target(
Custom ALL
COMMAND "${CMAKE_COMMAND}" -E copy_if_different ./customTarget.c "${TestWorkingDir_BINARY_DIR}/customTarget.c"
BYPRODUCTS "${TestWorkingDir_BINARY_DIR}/customTarget.c"
WORKING_DIRECTORY "${TestWorkingDir_SOURCE_DIR}"
)
@@ -36,6 +37,7 @@ add_executable(working2 working2.c ${TestWorkingDir_BINARY_DIR}/customTarget2.c)
add_custom_target(
Custom2 ALL
COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${TestWorkingDir_SOURCE_DIR}/customTarget.c ../customTarget2.c
BYPRODUCTS "${TestWorkingDir_BINARY_DIR}/customTarget2.c"
WORKING_DIRECTORY work/ # Relative to build tree, trailing slash
)