Notes |
|
(0036129)
|
Brad King
|
2014-06-09 09:19
|
|
Here is one example of the case in the description:
add_custom_target(Provider COMMAND some-generator -o side-effect)
add_custom_command(
OUTPUT explicit-output
COMMAND cp side-effect explicit-output
DEPENDS side-effect
)
add_custom_target(Consumer DEPENDS explicit-output)
add_dependencies(Consumer Provider) # ensure side-effect is up to date
Nothing here tells CMake that Provider also produces "side-effect" as an output, but the author of the code clearly knows this. |
|
|
(0036130)
|
Brad King
|
2014-06-09 09:20
|
|
Here is another example of the case in the description:
include(ExternalProject)
ExternalProject_Add(OtherProj ...)
add_library(OtherProj::OtherLib STATIC IMPORTED)
set_target_properties(OtherProj::OtherLib PROPERTIES ...)
add_dependencies(OtherProj::OtherLib OtherProj) # ensure OtherProj is up to date
add_executable(MyExe ...)
target_link_libraries(MyExe OtherProj::OtherLib) # gets dependency on OtherProj through imported target
The add_dependencies behavior for imported targets is intended exactly for the case that a custom target produces an imported target's file as a side-effect. This basically provides the information we need but not as clearly as it could. |
|
|
(0036131)
|
Brad King
|
2014-06-09 09:27
|
|
The example from ninja issue 760 is:
rule R
command = $COMMAND
build always: R
COMMAND = echo 1 >> out
build out: phony out
build out-copy: R out || always
COMMAND = cp out out-copy
build all: phony out-copy always
default all
The problem is that while evaluating out-copy the dependency on "out" is not re-stated after the order-only dependency on "always" is satisfied. Instead we should write:
rule R
command = $COMMAND
restat = 1
build always out: R
COMMAND = echo 1 >> out
build out-copy: R out || always
COMMAND = cp out out-copy
build all: phony out-copy always
default all
Note that we explicitly list "out" as an output of the rule for "always". By telling ninja to restat after evaluating the rule then if "out" were to not change then its dependents would not necessarily rebuild. This serves the same purpose as the explicit dependency on an implicit (side-effect) output used in 0014963:0036129 and 0014963:0036130. We just need a way for CMake to know enough information to generate this. |
|
|
(0037005)
|
Brad King
|
2014-10-08 09:40
|
|
|
|
(0037230)
|
Brad King
|
2014-11-17 11:37
|
|
|
|
(0037231)
|
Brad King
|
2014-11-17 11:49
|
|
|
|
(0037339)
|
Brad King
|
2014-12-01 14:32
|
|
|
|
(0039734)
|
Robert Maynard
|
2015-11-02 09:13
|
|
Closing resolved issues that have not been updated in more than 4 months. |
|