Order-only dependencies on a generator #14182
Unanswered
lhearachel
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As part of a project that I help maintain, we generate some binary data files using an assembler and assembler macros, e.g.,
We run each of these
*.s
files through the following generator:(Aside: the shell-script wrapper is so that we can execute an
objcopy
to extract thebinary
component of the assembler output, rather than effectively run one input file through two generators.)As the
TODO
comment notes, we have a dependency onmessage_banks_index
declared, which is a target declared earlier in the build-chain:This target is listed in
depends
only to ensure that some generated content is built ahead of running the generator (in the example above,res/text/gmm/message_bank_acuity_cavern.h
). Per thegenerator
docs, this seems to be the right approach for declaring such a dependency.However, this results in a change to any of the static files in
message_bank_files
to flag all of our assembly-generators as requiring rebuild; ideally, we would like to be able to declaremessage_banks_index
as an order-only dependency and rely on thedepfile
to denote which specific headers are implicit dependencies. We could list all of the specific headers that are tracked, but there are at least a hundred such headers, and that solution feels brittle for any user who forks our project.Is there a way to declare such a dependency as order-only for back-ends that support it? If not, where does that code live, and would it be a reasonable and/or welcome contribution?
Beta Was this translation helpful? Give feedback.
All reactions