Add only_interfaces
and with
to the bindgen!
macro.
#6160
Merged
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.
Add the
only_interfaces
andwith
options to thebindgen!
macro. These two additional options enable the definitions of a use ofbindgen!
to be split up and reused in the following way:only_interfaces: true
to an invocation ofbindgen!
will cause only the interfaces depended on by the supplied world to be generated, allowing the interface definitions depended on by two world files to be shared.with: { "a": module::name }
allows references to thea
import to be remapped to a known module, in this casemodule::name
. When this option is supplied, no code will be generated for the interfacea
, assuming that those definitions came from a previous use ofbindgen!
withonly_interfaces: true
.Here's a use in the
preview2-prototyping
repository for a motivating example of how this can be used with thecommand
world.