feat(ninja): Support depends in generator.process #15402
+86
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This adds support to specify additional dependencies during invocation of
generator.process, which will be merged with the list of dependencies for the generator itself to produce a full dependency mapping for each output target. This can be useful for creating a single generator for processing a given type of input file where some cases may require additional targets to be built before some subset of them can be used.Motivation
Consider the following illustration:
In this example, the
another_binary_file.bintarget accepts some input files which cannot be built correctly withoutmore_constants. However, the generator itself does not need to have this dependency, assome_binary_file.bin's input files do not require these to be built, and thus they should not be flagged as dirty ifmore_constantsis dirty.Testing
The test case in
commonis functional for the Ninja backend. I will need some help understanding the mental model for the VSCode and XCode backends to make similar changes, as I have never worked with them before.