@@ -311,7 +311,7 @@ def generate_bindings(api_filepath, use_template_get_node, bits="64", precision=
311311 generate_builtin_bindings (api , target_dir , real_t + "_" + bits )
312312 generate_engine_classes_bindings (api , target_dir , use_template_get_node )
313313 generate_utility_functions (api , target_dir )
314- generate_compat_includes (target_dir )
314+ generate_compat_includes (Path ( output_dir ), target_dir )
315315
316316
317317builtin_classes = []
@@ -1445,17 +1445,19 @@ def generate_engine_classes_bindings(api, output_dir, use_template_get_node):
14451445 header_file .write ("\n " .join (result ))
14461446
14471447
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"
14511452 if not godot_compat .exists ():
1453+ print ("Skipping godot_compat" )
14521454 return
14531455 with godot_compat .open () as file :
14541456 mapping2 = json .load (file )
14551457 # Match the headers
14561458 file_types_mapping = match_headers (file_types_mapping_godot_cpp , mapping2 )
14571459
1458- include_gen_folder = Path (output_dir ) / "include"
1460+ include_gen_folder = Path (target_dir ) / "include"
14591461 for file_godot_cpp_name , file_godot_names in file_types_mapping .items ():
14601462 header_filename = file_godot_cpp_name .replace ("godot_cpp" , "godot_compat" )
14611463 header_filepath = include_gen_folder / header_filename
@@ -1476,8 +1478,8 @@ def generate_compat_includes(output_dir):
14761478 result .append (f"#endif" )
14771479 result .append ("" )
14781480 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))
14811483
14821484
14831485def generate_engine_class_header (class_api , used_classes , fully_used_classes , use_template_get_node ):
0 commit comments