summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2017-01-26 17:26:02 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2017-01-26 20:34:57 +0100
commit78e425f921085030585c93ed1eb0b96b5cb3b4b5 (patch)
treed74fddd91158b753aeb47a13bfc7e122b17b63f1 /src/lib.rs
parent7d7c49aaa3b9b5c01d2afac70660575f1bb562b2 (diff)
ir: Allow whitelisting non-recursivelyv0.20.3
Fixes #429
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index c28e3168..dabab152 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -188,6 +188,16 @@ impl Builder {
self
}
+ /// Whether to whitelist types recursively or not. Defaults to true.
+ ///
+ /// This can be used to get bindgen to generate _exactly_ the types you want
+ /// in your bindings, and then import other types manually via other means
+ /// (like `raw_line`).
+ pub fn whitelist_recursively(mut self, doit: bool) -> Self {
+ self.options.whitelist_recursively = doit;
+ self
+ }
+
/// Generate a C/C++ file that includes the header and has dummy uses of
/// every type defined in the header.
pub fn dummy_uses<T: Into<String>>(mut self, dummy_uses: T) -> Builder {
@@ -529,6 +539,9 @@ pub struct BindgenOptions {
/// Wether to keep documentation comments in the generated output. See the
/// documentation for more details.
pub generate_comments: bool,
+
+ /// Wether to whitelist types recursively. Defaults to true.
+ pub whitelist_recursively: bool,
}
impl BindgenOptions {
@@ -574,6 +587,7 @@ impl Default for BindgenOptions {
codegen_config: CodegenConfig::all(),
conservative_inline_namespaces: false,
generate_comments: true,
+ whitelist_recursively: true,
}
}
}