Generates a rust source file from a cc_library and a header.
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
bindgen_flags | Flags to pass directly to the bindgen executable. See https://rust-lang.github.io/rust-bindgen/ for details. | List of strings | optional | [] |
cc_lib | The cc_library that contains the .h file. This is used to find the transitive includes. | Label | optional | None |
clang_flags | Flags to pass directly to the clang executable. | List of strings | optional | [] |
header | The .h file to generate bindings for. | Label | optional | None |
The tools required for the rust_bindgen
rule.
ATTRIBUTES
Name | Description | Type | Mandatory | Default |
---|---|---|---|---|
name | A unique name for this target. | Name | required | |
bindgen | The label of a bindgen executable. | Label | optional | None |
clang | The label of a clang executable. | Label | optional | None |
libclang | A cc_library that provides bindgen's runtime dependency on libclang. | Label | optional | None |
libstdcxx | A cc_library that satisfies libclang's libstdc++ dependency. | Label | optional | None |
rustfmt | The label of a rustfmt executable. If this is provided, generated sources will be formatted. | Label | optional | None |
Generates a rust source file for header
, and builds a rust_library.
Arguments are the same as rust_bindgen
, and kwargs
are passed directly to rust_library.
PARAMETERS
Name | Description | Default Value |
---|---|---|
name | A unique name for this target. | none |
header | The label of the .h file to generate bindings for. | none |
cc_lib | The label of the cc_library that contains the .h file. This is used to find the transitive includes. | none |
bindgen_flags | Flags to pass directly to the bindgen executable. See https://rust-lang.github.io/rust-bindgen/ for details. | None |
clang_flags | Flags to pass directly to the clang executable. | None |
kwargs | Arguments to forward to the underlying rust_library rule. | none |
Declare dependencies needed for bindgen.