summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib.rs15
-rw-r--r--src/options.rs8
2 files changed, 23 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 05d7ea3e..20997267 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -484,6 +484,10 @@ impl Builder {
output_vector.push("--disable-nested-struct-naming".into());
}
+ if self.options.disable_header_comment {
+ output_vector.push("--disable-header-comment".into());
+ }
+
if !self.options.codegen_config.functions() {
output_vector.push("--ignore-functions".into());
}
@@ -714,6 +718,13 @@ impl Builder {
self
}
+ /// Disable insertion of bindgen's version identifier into generated
+ /// bindings.
+ pub fn disable_header_comment(mut self) -> Self {
+ self.options.disable_header_comment = true;
+ self
+ }
+
/// Set the output graphviz file.
pub fn emit_ir_graphviz<T: Into<String>>(mut self, path: T) -> Builder {
let path = path.into();
@@ -1664,6 +1675,9 @@ struct BindgenOptions {
/// True if we should avoid generating nested struct names.
disable_nested_struct_naming: bool,
+ /// True if we should avoid embedding version identifiers into source code.
+ disable_header_comment: bool,
+
/// True if we should generate layout tests for generated structures.
layout_tests: bool,
@@ -1925,6 +1939,7 @@ impl Default for BindgenOptions {
enable_function_attribute_detection: false,
disable_name_namespacing: false,
disable_nested_struct_naming: false,
+ disable_header_comment: false,
use_core: false,
ctypes_prefix: None,
namespaced_constants: true,
diff --git a/src/options.rs b/src/options.rs
index c2de1e5a..0add7b4c 100644
--- a/src/options.rs
+++ b/src/options.rs
@@ -272,6 +272,10 @@ where
.help(
"Disable support for native Rust unions.",
),
+ Arg::with_name("disable-header-comment")
+ .long("disable-header-comment")
+ .help("Suppress insertion of bindgen's version identifier into generated bindings.")
+ .multiple(true),
Arg::with_name("ignore-functions")
.long("ignore-functions")
.help(
@@ -676,6 +680,10 @@ where
builder = builder.disable_untagged_union();
}
+ if matches.is_present("disable-header-comment") {
+ builder = builder.disable_header_comment();
+ }
+
if matches.is_present("ignore-functions") {
builder = builder.ignore_functions();
}