Skip to content

Adds module mapping of includes for Rust code generation #8563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

csmulhern
Copy link
Contributor

Adds a new --module-mapping flag to flatc that can be used to map included file paths to existing modules that have been compiled for those schemas.

This is useful for module based languages (e.g. Swift, Rust), as it allows schemas to be compiled into different units (modules) while still referencing one another. In order for the flatbuffer compiler to know the module associated with a particular schema, a mapping is passed in the command line invocation, using the format --module-mapping PATH=MODULE. Multiple uses of this flag are accumulated, so that multiple schemas can be simultaneously mapped.

Initial support has been added in the Rust code generator.

For more background on what motivated this change, see the discussion in #8273.

Fixes #8273.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ codegen Involving generating code from schema python rust
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Rust] Add better support for "crate-per-schema"
1 participant