-
For example in Ninja it is possible for a build rule to output a list of dependencies the file has (such as what headers a C file used.) It then load that list of dependencies and stores them in the cache for future use. This allows it to suss out which C files need to be recompiled whenever some headers are changed without each one being explicitly specified. I noticed there are |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Looking in to this I checked if C/C++ targets are rebuilt by looking at the dependency graph for each .c file.
|
Beta Was this translation helpful? Give feedback.
-
I don't see anywhere where the build rules would be cached so it looks like no, they are not. It looks like you would have to use this out of band and put the dependencies in the BUILD file. |
Beta Was this translation helpful? Give feedback.
-
Correct, they are not persisted - the function is re-evaluated on each plz invocation. However the stdout of an action that's passed to the post-build function is persisted in the cache, so the actual commands don't need to get rerun, and hence they don't prevent incremental rebuilds. |
Beta Was this translation helpful? Give feedback.
I don't see anywhere where the build rules would be cached so it looks like no, they are not. It looks like you would have to use this out of band and put the dependencies in the BUILD file.