[vtk-developers] Moved Mirkwood ninja dashboards to nightly
Brad King
brad.king at kitware.com
Tue Apr 2 09:11:53 EDT 2013
On 04/01/2013 02:46 PM, Brad King wrote:
> If someone encountering the problem can narrow down a dependency
> failure to an example test case then the problem can be reported,
Here is a minimal example reproducible on Linux::
cmake_minimum_required(VERSION 2.8.10)
project(DependSideEffect C)
add_library(A a.c)
add_custom_command(
TARGET A POST_BUILD
COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/a.c a.txt
)
add_custom_command(
OUTPUT b.txt
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/a.txt
COMMAND cp a.txt b.txt
)
add_custom_target(B ALL DEPENDS b.txt)
add_dependencies(B A)
Building with Ninja fails with::
ninja: error: 'a.txt', needed by 'b.txt', missing and no known rule to make it
Relevant portions of build.ninja:
build libA.a: C_STATIC_LIBRARY_LINKER CMakeFiles/A.dir/a.c.o
POST_BUILD = cd ".../build" && cp .../a.c a.txt
...
build b.txt: CUSTOM_COMMAND a.txt || libA.a
COMMAND = cd ".../build" && cp a.txt b.txt
...
The rule for "b.txt" has an order-only dependency on "libA.a" and
a full dependency on "a.txt". Ninja does not wait for the order-only
dependencies to be up to date before evaluating the full dependencies
and then complains that the latter is missing.
-Brad
More information about the vtk-developers
mailing list