Skip to content

Commit c531aa8

Browse files
committed
Update binding_generator.py
1 parent 5783b96 commit c531aa8

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

binding_generator.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,10 +1448,14 @@ def generate_engine_classes_bindings(api, output_dir, use_template_get_node):
14481448
def generate_compat_includes(output_dir: Path, target_dir: Path):
14491449
file_types_mapping_godot_cpp_gen = map_header_files(target_dir / "include")
14501450
file_types_mapping_godot_cpp = map_header_files(output_dir / "include") | file_types_mapping_godot_cpp_gen
1451-
godot_compat = output_dir / "output_header_mapping_godot.json"
1452-
if not godot_compat.exists():
1453-
print("Skipping godot_compat")
1454-
return
1451+
godot_compat = Path("output_header_mapping_godot.json")
1452+
levels_to_look_back = 3
1453+
while not godot_compat.exists():
1454+
godot_compat = ".." / godot_compat
1455+
levels_to_look_back -= 1
1456+
if levels_to_look_back == 0:
1457+
print("Skipping godot_compat")
1458+
return
14551459
with godot_compat.open() as file:
14561460
mapping2 = json.load(file)
14571461
# Match the headers
@@ -1478,8 +1482,8 @@ def generate_compat_includes(output_dir: Path, target_dir: Path):
14781482
result.append(f"#endif")
14791483
result.append("")
14801484
result.append(f"#endif // ! {header_guard}")
1481-
#with header_filepath.open("w+", encoding="utf-8") as header_file:
1482-
# header_file.write("\n".join(result))
1485+
with header_filepath.open("w+", encoding="utf-8") as header_file:
1486+
header_file.write("\n".join(result))
14831487

14841488

14851489
def generate_engine_class_header(class_api, used_classes, fully_used_classes, use_template_get_node):

0 commit comments

Comments
 (0)