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.
This PR adds support for configuration files when using
bindgen-cli
.The main motivation for this feature is that, with the growing number of options that bindgen has, it is hard to keep track on the options used in each invocation.
I decided to use TOML as it has become the de-facto configuration format in several Rust projects such as Cargo and Rustfmt.
To use this feature you can either pass the
--config-path
arguments to bindgen with the path to the configuration file, or create abindgen.toml
file in the current directory.If you want to use this feature but you don't want to transcribe your CLI arguments by hand, you can use the
--dump-config
flag to dump the passed configuration into stdout.If you want to keep using bindgen the old way, you can pass the
--ignore-config
flag. Which will ignore any configuration file, this includes both the--config-path
argument and the defaultbindgen.toml
file.Fixes #1898 and #2508