Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name = "bindgen"
readme = "README.md"
repository = "https://github.com/servo/rust-bindgen"
documentation = "https://docs.rs/bindgen"
version = "0.23.0"
version = "0.23.1"
build = "build.rs"

exclude = [
Expand Down
4 changes: 1 addition & 3 deletions bindgen-integration/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ fn main() {
.enable_cxx_namespaces()
.raw_line("pub use self::root::*;")
.header("cpp/Test.h")
.clang_arg("-x")
.clang_arg("c++")
.clang_arg("-std=c++11")
.clang_args(&["-x", "c++", "-std=c++11"])
.parse_callbacks(Box::new(MacroCallback {macros: macros.clone()}))
.generate()
.expect("Unable to generate bindings");
Expand Down
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,16 @@ impl Builder {
self
}

/// Add arguments to be passed straight through to clang.
pub fn clang_args<I>(mut self, iter: I) -> Builder
where I: IntoIterator,
I::Item: AsRef<str> {
for arg in iter {
self = self.clang_arg(arg.as_ref())
}
self
}

/// Make the generated bindings link the given shared library.
pub fn link<T: Into<String>>(mut self, library: T) -> Builder {
self.options.links.push((library.into(), LinkType::Default));
Expand Down