Skip to content

Commit 79dfe0c

Browse files
author
Vano
committed
empty header fix, parse defs from srcfile only
1 parent b327a65 commit 79dfe0c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cppscript.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ def parse_class(parent, class_cursors):
213213

214214
def parse_cursor(parent):
215215
for cursor in parent.get_children():
216+
if cursor.location.file is None or cursor.location.file.name != filename:
217+
continue
218+
216219
match cursor.kind:
217220
case CursorKind.CLASS_DECL:
218221
classes_and_Gmacros.append(cursor)
@@ -554,6 +557,7 @@ def write_header(file, defs, src):
554557
([outside_bind] if outside_bind != '' else [])
555558

556559
file_name = filename_to_gen_filename(file, src)
560+
content = ''
557561
if len(defs) != 0:
558562
header_include = '#include <cppscript_bindings.h>\n\n#include <{}>\n\nusing namespace godot;\n\n'.format(os.path.relpath(file, src).replace('\\', '/'))
559563
content = header_include + '\n'.join(header_defs)

0 commit comments

Comments
 (0)