diff options
author | Travis Finkenauer <tmfinken@gmail.com> | 2020-06-07 15:11:23 -0400 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2020-06-08 11:21:14 +0200 |
commit | 93adc70ed8ebb10f9356abd8df97bed68cf908ad (patch) | |
tree | 4cfd62cef576ec4f39aba5793afd5f1faf82c0eb /README.md | |
parent | de23676c4b7feca98c8418bf701ce5ce80f7e4e7 (diff) |
Document environment variables in README
Mention BINDGEN_EXTRA_CLANG_ARGS and clang-sys variables.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -47,6 +47,28 @@ No MSRV bump policy has been established yet, so MSRV may increase in any releas [API reference documentation is on docs.rs](https://docs.rs/bindgen) +## Environment Variables + +In addition to the [library API](https://docs.rs/bindgen) and [executable command-line API][bindgen-cmdline], +`bindgen` can be controlled through environment variables. + +End-users should set these environment variables to modify `bindgen`'s behavior without modifying the source code of direct consumers of `bindgen`. + +- `BINDGEN_EXTRA_CLANG_ARGS`: extra arguments to pass to `clang` + - Arguments are whitespace-separated + - Use shell-style quoting to pass through whitespace + - Examples: + - Specify alternate sysroot: `--sysroot=/path/to/sysroot` + - Add include search path with spaces: `-I"/path/with spaces"` + +Additionally, `bindgen` uses `libclang` to parse C and C++ header files. +To modify how `bindgen` searches for `libclang`, see the [`clang-sys` documentation][clang-sys-env]. +For more details on how `bindgen` uses `libclang`, see the [`bindgen` users guide][bindgen-book-clang]. + ## Contributing [See `CONTRIBUTING.md` for hacking on `bindgen`!](./CONTRIBUTING.md) + +[bindgen-cmdline]: https://rust-lang.github.io/rust-bindgen/command-line-usage.html +[clang-sys-env]: https://github.com/KyleMayes/clang-sys#environment-variables +[bindgen-book-clang]: https://rust-lang.github.io/rust-bindgen/requirements.html#clang
\ No newline at end of file |