summaryrefslogtreecommitdiff
path: root/bindgen-cli/options.rs
diff options
context:
space:
mode:
Diffstat (limited to 'bindgen-cli/options.rs')
-rw-r--r--bindgen-cli/options.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/bindgen-cli/options.rs b/bindgen-cli/options.rs
index 2b09d85f..458c7bab 100644
--- a/bindgen-cli/options.rs
+++ b/bindgen-cli/options.rs
@@ -353,6 +353,20 @@ struct BindgenCommand {
/// Derive custom traits on a `union`. The <CUSTOM> value must be of the shape <REGEX>=<DERIVE> where <DERIVE> is a coma-separated list of derive macros.
#[arg(long, value_name = "CUSTOM")]
with_derive_custom_union: Vec<String>,
+ /// Generate wrappers for `static` and `static inline` functions.
+ #[arg(long, requires = "experimental")]
+ wrap_static_fns: bool,
+ /// Sets the path for the source file that must be created due to the presence of `static` and
+ /// `static inline` functions.
+ #[arg(long, requires = "experimental", value_name = "PATH")]
+ wrap_static_fns_path: Option<PathBuf>,
+ /// Sets the suffix added to the extern wrapper functions generated for `static` and `static
+ /// inline` functions.
+ #[arg(long, requires = "experimental", value_name = "SUFFIX")]
+ wrap_static_fns_suffix: Option<String>,
+ /// Enables experimental features.
+ #[arg(long)]
+ experimental: bool,
/// Prints the version, and exits
#[arg(short = 'V', long)]
version: bool,
@@ -473,6 +487,10 @@ where
with_derive_custom_struct,
with_derive_custom_enum,
with_derive_custom_union,
+ wrap_static_fns,
+ wrap_static_fns_path,
+ wrap_static_fns_suffix,
+ experimental: _,
version,
clang_args,
} = command;
@@ -978,5 +996,17 @@ where
}
}
+ if wrap_static_fns {
+ builder = builder.wrap_static_fns(true);
+ }
+
+ if let Some(path) = wrap_static_fns_path {
+ builder = builder.wrap_static_fns_path(path);
+ }
+
+ if let Some(suffix) = wrap_static_fns_suffix {
+ builder = builder.wrap_static_fns_suffix(suffix);
+ }
+
Ok((builder, output, verbose))
}