Skip to content

Commit

Permalink
rename to extra_bindings per IRC discussion.
Browse files Browse the repository at this point in the history
  • Loading branch information
emilio committed Jun 25, 2019
1 parent 16b2a25 commit 5f8e027
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions src/bindgen/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
pub extra_bindings: Vec<String>,
}

impl ParseConfig {
Expand All @@ -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)
}
}

Expand Down
2 changes: 1 addition & 1 deletion template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ parse_deps = false
# include = []
exclude = []
clean = false
# deps_with_top_level_items = []
extra_bindings = []



Expand Down
2 changes: 1 addition & 1 deletion tests/rust/workspace/cbindgen.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[parse]
parse_deps = true
deps_with_top_level_items = ["dep"]
extra_bindings = ["dep"]

0 comments on commit 5f8e027

Please sign in to comment.