Only emit cfg attr if requested during namespace gen
@@ -53,9 +53,15 @@ pub fn gen_namespace(gen: &Gen) -> String {
let name = gen_ident(name);
let namespace = tree.namespace[tree.namespace.find('.').unwrap() + 1..].replace('.', "_");
+ if gen.cfg {
quote! {
#[cfg(feature = #namespace)] pub mod #name;
}
+ } else {
+ quote! {
+ pub mod #name;
+ }
+ }
});
let functions = gen_sys_functions(tree, gen);
