diff --git a/docs.md b/docs.md index 3d0188447..63ab3fe1a 100644 --- a/docs.md +++ b/docs.md @@ -752,10 +752,10 @@ exclude = ["libc"] clean = false # Which crates other than the top-level binding crate we should generate -# top-level constants / globals and functions. +# bindings for. # # default: [] -deps_with_top_level_items = ["my_awesome_dep"] +extra_bindings = ["my_awesome_dep"] [parse.expand] # A list of crate names that should be run through `cargo expand` before diff --git a/src/bindgen/config.rs b/src/bindgen/config.rs index 0c917bd45..d2b13d71b 100644 --- a/src/bindgen/config.rs +++ b/src/bindgen/config.rs @@ -564,7 +564,7 @@ pub struct ParseConfig { pub clean: bool, /// List of crate names which generate consts, statics, and fns. By default /// no dependent crates generate them. - pub deps_with_top_level_items: Vec, + pub extra_bindings: Vec, } impl ParseConfig { @@ -578,9 +578,7 @@ impl ParseConfig { return true; } - self.deps_with_top_level_items - .iter() - .any(|dep| dep == crate_name) + self.extra_bindings.iter().any(|dep| dep == crate_name) } } diff --git a/template.toml b/template.toml index 4b4829e07..d61e5c25b 100644 --- a/template.toml +++ b/template.toml @@ -127,7 +127,7 @@ parse_deps = false # include = [] exclude = [] clean = false -# deps_with_top_level_items = [] +extra_bindings = [] diff --git a/tests/rust/workspace/cbindgen.toml b/tests/rust/workspace/cbindgen.toml index 8629f9e17..d2fea7e78 100644 --- a/tests/rust/workspace/cbindgen.toml +++ b/tests/rust/workspace/cbindgen.toml @@ -1,3 +1,3 @@ [parse] parse_deps = true -deps_with_top_level_items = ["dep"] +extra_bindings = ["dep"]