Allowing custom targets to depend on builtin targets #12324
mitchgrout
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A use case I have is to instrument my unit tests to emit coverage information, run all of the tests, and then use
gcovr
or similar to collate the generated results. It would be convenient if I were able to write something like......as then I can do the following to generate my coverage reports:
Unfortunately there's no way to currently specify this relation between my
custom_target
and a builtin liketest
, so I instead have to have this odd loose coupling when running the taskand if I forget to run
test
before (or have stale results), then thecoverage
output is going to be incorrect.Being able to fetch one of the builtin targets via a method like
builtin_target(str)
would allow me to correctly sequence this task. There are some drawbacks I can see:test()
after declaring this target that depends on all tests? Could be an error similar to howadd_project_arguments
fails after defining the first build targetbuiltin_task('all')
and build a cycle? Ninja would detect, but certain tasks could be excludedThoughts?
Beta Was this translation helpful? Give feedback.
All reactions