diff --git a/src/bindings.rs b/src/bindings.rs index 1303280..3930225 100644 --- a/src/bindings.rs +++ b/src/bindings.rs @@ -120,15 +120,14 @@ impl<'a> BindingsGenerator<'a> { .iter() .map(|(key, value)| (key.clone(), WithOption::Path(value.clone()))) .collect(), + generate_all: settings.generate_all, type_section_suffix: settings.type_section_suffix.clone(), disable_run_ctors_once_workaround: settings.disable_run_ctors_once_workaround, default_bindings_module: settings.default_bindings_module.clone(), export_macro_name: settings.export_macro_name.clone(), pub_export_macro: settings.pub_export_macro, generate_unused_types: settings.generate_unused_types, - // todo - add support for these settings - generate_all: true, - disable_custom_section_link_helpers: false, + disable_custom_section_link_helpers: settings.disable_custom_section_link_helpers, }; let mut files = Files::default(); diff --git a/src/metadata.rs b/src/metadata.rs index 4eac211..a9abdb7 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -85,6 +85,9 @@ pub struct Bindings { pub export_prefix: Option, /// Remapping of interface names to rust module names. pub with: HashMap, + /// Indicates that all interfaces not specified in `with` should be + /// generated. + pub generate_all: bool, /// Add the specified suffix to the name of the custome section containing /// the component type. pub type_section_suffix: Option, @@ -101,6 +104,12 @@ pub struct Bindings { pub pub_export_macro: bool, /// Whether to generate unused structures, not generated by default (false) pub generate_unused_types: bool, + /// Whether or not to generate helper function/constants to help link custom + /// sections into the final output. + /// + /// Disabling this can shave a few bytes off a binary but makes + /// library-based usage of `generate!` prone to breakage. + pub disable_custom_section_link_helpers: bool, } impl Default for Bindings { @@ -115,12 +124,14 @@ impl Default for Bindings { stubs: Default::default(), export_prefix: Default::default(), with: Default::default(), + generate_all: true, type_section_suffix: Default::default(), disable_run_ctors_once_workaround: Default::default(), default_bindings_module: Default::default(), export_macro_name: Default::default(), pub_export_macro: Default::default(), generate_unused_types: Default::default(), + disable_custom_section_link_helpers: Default::default(), } } }