Skip to content

Specifying Build-Dependency on Generated Headers #13107

Answered by eli-schwartz
lhearachel asked this question in Q&A
Discussion options

You must be logged in to vote

Is there a best practice beyond this for ensuring that this process always runs before any source-code files are passed to compilation? Or does meson automagically trace that dependency from the #include directives inside the source-code files?

Both.

  • You need to add the custom_target output as one of the source files for any target that has C files which includes the generated header. Otherwise, depending on scheduling, the C file might try to compile before the header has been created for the first time, and it will fail. This is only relevant for the first time building, as it's a soft dependency. It is impossible to bootstrap the dependency tracker until compilation runs at least on…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dcbaker
Comment options

Answer selected by lhearachel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants