Skip to content

Commit 117e2a1

Browse files
tmfinkemilio
authored andcommitted
Document BINDGEN_EXTRA_CLANG_ARGS env variable
Feature was originally introduced in pull-request #1537
1 parent b9ed1a1 commit 117e2a1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,21 @@ impl Default for CodegenConfig {
191191
/// 4. Rustified enum
192192
///
193193
/// If none of the above patterns match, then bindgen will generate a set of Rust constants.
194+
///
195+
/// # Clang arguments
196+
///
197+
/// Extra arguments can be passed to with clang:
198+
/// 1. [`clang_arg()`](#method.clang_arg): takes a single argument
199+
/// 2. [`clang_args()`](#method.clang_args): takes an iterator of arguments
200+
/// 3. `BINDGEN_EXTRA_CLANG_ARGS` environment variable: whitespace separate
201+
/// environment variable of arguments
202+
///
203+
/// Clang arguments specific to your crate should be added via the
204+
/// `clang_arg()`/`clang_args()` methods.
205+
///
206+
/// End-users of the crate may need to set the `BINDGEN_EXTRA_CLANG_ARGS` environment variable to
207+
/// add additional arguments. For example, to build against a different sysroot a user could set
208+
/// `BINDGEN_EXTRA_CLANG_ARGS` to `--sysroot=/path/to/sysroot`.
194209
#[derive(Debug, Default)]
195210
pub struct Builder {
196211
options: BindgenOptions,

0 commit comments

Comments
 (0)