Commit 58caa33f authored by Ryan Hunt's avatar Ryan Hunt
Browse files

Put template specialization behind a config

parent be9a8f44
...@@ -100,6 +100,8 @@ rename_args = "[None|GeckoCase|LowerCase|UpperCase|PascalCase|CamelCase|SnakeCas ...@@ -100,6 +100,8 @@ rename_args = "[None|GeckoCase|LowerCase|UpperCase|PascalCase|CamelCase|SnakeCas
[struct] [struct]
# A rule to use to rename field names # A rule to use to rename field names
rename_fields = "[None|GeckoCase|LowerCase|UpperCase|PascalCase|CamelCase|SnakeCase|ScreamingSnakeCase|QualifiedScreamingSnakeCase]" rename_fields = "[None|GeckoCase|LowerCase|UpperCase|PascalCase|CamelCase|SnakeCase|ScreamingSnakeCase|QualifiedScreamingSnakeCase]"
# Whether to generate helper template specialization for generics
generic_template_specialization = true,
# Whether to derive an operator== for all structs # Whether to derive an operator== for all structs
derive_eq = false derive_eq = false
# Whether to derive an operator!= for all structs # Whether to derive an operator!= for all structs
......
...@@ -145,6 +145,8 @@ impl FunctionConfig { ...@@ -145,6 +145,8 @@ impl FunctionConfig {
pub struct StructConfig { pub struct StructConfig {
/// The rename rule to apply to the name of struct fields /// The rename rule to apply to the name of struct fields
pub rename_fields: Option<RenameRule>, pub rename_fields: Option<RenameRule>,
/// Whether to generate helper template specialization for generics
pub generic_template_specialization: bool,
/// Whether to generate a piecewise equality operator /// Whether to generate a piecewise equality operator
pub derive_eq: bool, pub derive_eq: bool,
/// Whether to generate a piecewise inequality operator /// Whether to generate a piecewise inequality operator
...@@ -163,6 +165,7 @@ impl Default for StructConfig { ...@@ -163,6 +165,7 @@ impl Default for StructConfig {
fn default() -> StructConfig { fn default() -> StructConfig {
StructConfig { StructConfig {
rename_fields: None, rename_fields: None,
generic_template_specialization: true,
derive_eq: false, derive_eq: false,
derive_neq: false, derive_neq: false,
derive_lt: false, derive_lt: false,
......
...@@ -776,7 +776,8 @@ impl GeneratedBindings { ...@@ -776,7 +776,8 @@ impl GeneratedBindings {
out.new_line(); out.new_line();
} }
if self.config.language == Language::Cxx { if self.config.structure.generic_template_specialization &&
self.config.language == Language::Cxx {
for (path, monomorph_sets) in &self.monomorphs { for (path, monomorph_sets) in &self.monomorphs {
if monomorph_sets.len() == 0 { if monomorph_sets.len() == 0 {
continue; continue;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment