summaryrefslogtreecommitdiff
path: root/bindgen/lib.rs
diff options
context:
space:
mode:
authorDan Dumont <dan.dumont@hcl.com>2023-01-20 15:12:42 -0500
committerGitHub <noreply@github.com>2023-01-20 15:12:42 -0500
commitbca47cd9c2e718012f7f953be25bb3a6a9ca400b (patch)
tree432dc9180f96a0365c9c49f73158a26f51e727d1 /bindgen/lib.rs
parent190a017a100b00aeebe2c5e5acfd5ee699a655c9 (diff)
Implement cli option for custom derive (#2328)
* custom derives after DeriveInfo * Introduce `TypeKind` instead of `CompKind` * Add tests * Emit CLI flags for callbacks * update changelog * run rustfmt * fix tests * fix features Co-authored-by: Christian Poveda <christian.poveda@ferrous-systems.com>
Diffstat (limited to 'bindgen/lib.rs')
-rw-r--r--bindgen/lib.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/bindgen/lib.rs b/bindgen/lib.rs
index 46444a93..cf1486c2 100644
--- a/bindgen/lib.rs
+++ b/bindgen/lib.rs
@@ -65,7 +65,7 @@ mod clang;
mod codegen;
mod deps;
mod features;
-mod ir;
+pub mod ir;
mod parse;
mod regex_set;
mod time;
@@ -91,7 +91,7 @@ use crate::ir::context::{BindgenContext, ItemId};
pub use crate::ir::function::Abi;
use crate::ir::item::Item;
use crate::parse::ParseError;
-use crate::regex_set::RegexSet;
+pub use crate::regex_set::RegexSet;
use std::borrow::Cow;
use std::env;
@@ -653,6 +653,11 @@ impl Builder {
output_vector.push("--wrap-unsafe-ops".into());
}
+ #[cfg(feature = "cli")]
+ for callbacks in &self.options.parse_callbacks {
+ output_vector.extend(callbacks.cli_args());
+ }
+
// Add clang arguments
output_vector.push("--".into());