Fix bug with duplicated #include directives being generated, each include times the number of submodules+1
This commit is contained in:
1 parent
a2f8ebcb25
commit
5c426253fa
1 file changed
+7
-3
+7
-3
@@ -482,12 +482,16 @@ class ModuleBase(dict):
|
||||
code_sink.unindent()
|
||||
code_sink.writeln('}')
|
||||
|
||||
## generate the include directives
|
||||
for include in self.includes:
|
||||
includes_code_sink.writeln("#include %s" % include)
|
||||
## generate the include directives (only the root module)
|
||||
if self.parent is None:
|
||||
for include in self.includes:
|
||||
includes_code_sink.writeln("#include %s" % include)
|
||||
|
||||
## append the 'header' section to the 'includes' section
|
||||
self.header.flush_to(includes_code_sink)
|
||||
|
||||
def __repr__(self):
|
||||
return "<pybindgen.module.Module %r>" % self.name
|
||||
|
||||
|
||||
class Module(ModuleBase):
|
||||
|
||||
Reference in new issue
Block a user