@@ -311,7 +311,7 @@ def generate_bindings(api_filepath, use_template_get_node, bits="64", precision=
311
311
generate_builtin_bindings (api , target_dir , real_t + "_" + bits )
312
312
generate_engine_classes_bindings (api , target_dir , use_template_get_node )
313
313
generate_utility_functions (api , target_dir )
314
- generate_compat_includes (target_dir )
314
+ generate_compat_includes (Path ( output_dir ), target_dir )
315
315
316
316
317
317
builtin_classes = []
@@ -1445,17 +1445,19 @@ def generate_engine_classes_bindings(api, output_dir, use_template_get_node):
1445
1445
header_file .write ("\n " .join (result ))
1446
1446
1447
1447
1448
- def generate_compat_includes (output_dir ):
1449
- file_types_mapping_godot_cpp = map_header_files ("gen/include" )
1450
- godot_compat = Path ("output_header_mapping_godot.json" )
1448
+ def generate_compat_includes (output_dir : Path , target_dir : Path ):
1449
+ file_types_mapping_godot_cpp_gen = map_header_files (target_dir / "include" )
1450
+ 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"
1451
1452
if not godot_compat .exists ():
1453
+ print ("Skipping godot_compat" )
1452
1454
return
1453
1455
with godot_compat .open () as file :
1454
1456
mapping2 = json .load (file )
1455
1457
# Match the headers
1456
1458
file_types_mapping = match_headers (file_types_mapping_godot_cpp , mapping2 )
1457
1459
1458
- include_gen_folder = Path (output_dir ) / "include"
1460
+ include_gen_folder = Path (target_dir ) / "include"
1459
1461
for file_godot_cpp_name , file_godot_names in file_types_mapping .items ():
1460
1462
header_filename = file_godot_cpp_name .replace ("godot_cpp" , "godot_compat" )
1461
1463
header_filepath = include_gen_folder / header_filename
@@ -1476,8 +1478,8 @@ def generate_compat_includes(output_dir):
1476
1478
result .append (f"#endif" )
1477
1479
result .append ("" )
1478
1480
result .append (f"#endif // ! { header_guard } " )
1479
- with header_filepath .open ("w+" , encoding = "utf-8" ) as header_file :
1480
- header_file .write ("\n " .join (result ))
1481
+ # with header_filepath.open("w+", encoding="utf-8") as header_file:
1482
+ # header_file.write("\n".join(result))
1481
1483
1482
1484
1483
1485
def generate_engine_class_header (class_api , used_classes , fully_used_classes , use_template_get_node ):
0 commit comments