Skip to content

Commit

Permalink
Update binding_generator.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Ughuuu committed Oct 20, 2024
1 parent 1f04176 commit 7097bd2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions binding_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,11 @@ def get_file_list(api_filepath, output_dir, headers=False, sources=False, profil
continue

header_filename = include_gen_folder / "variant" / (camel_to_snake(builtin_class["name"]) + ".hpp")
header_compat_filename = include_gen_compat_folder / "variant" / (camel_to_snake(builtin_class["name"]) + ".hpp")
source_filename = source_gen_folder / "variant" / (camel_to_snake(builtin_class["name"]) + ".cpp")
if headers:
files.append(str(header_filename.as_posix()))
files.append(str(header_compat_filename.as_posix()))
if sources:
files.append(str(source_filename.as_posix()))

Expand All @@ -236,11 +238,12 @@ def get_file_list(api_filepath, output_dir, headers=False, sources=False, profil
engine_class["name"] = "ClassDBSingleton"
engine_class["alias_for"] = "ClassDB"
header_filename = include_gen_folder / "classes" / (camel_to_snake(engine_class["name"]) + ".hpp")
header_compat_filename = include_gen_compat_folder / "classes" / (camel_to_snake(engine_class["name"]) + ".hpp")
source_filename = source_gen_folder / "classes" / (camel_to_snake(engine_class["name"]) + ".cpp")
if headers:
files.append(str(header_filename.as_posix()))
files.append(str(header_compat_filename.as_posix()))
if sources:
if sources and is_class_included(engine_class["name"], build_profile):
files.append(str(source_filename.as_posix()))

for native_struct in api["native_structures"]:
Expand All @@ -250,8 +253,10 @@ def get_file_list(api_filepath, output_dir, headers=False, sources=False, profil
snake_struct_name = camel_to_snake(struct_name)

header_filename = include_gen_folder / "classes" / (snake_struct_name + ".hpp")
header_compat_filename = include_gen_compat_folder / "classes" / (snake_struct_name + ".hpp")
if headers:
files.append(str(header_filename.as_posix()))
files.append(str(header_compat_filename.as_posix()))

if headers:
for path in [
Expand Down Expand Up @@ -1585,7 +1590,6 @@ def generate_compat_includes(output_dir: Path, target_dir: Path):
result.append(f"#include <{file_godot_name}>")
result.append(f"#else")
result.append(f"#include <{file_godot_cpp_name}>")
result.append(f"using namespace godot;")
result.append(f"#endif")
result.append("")
result.append(f"#endif // ! {header_guard}")
Expand Down

0 comments on commit 7097bd2

Please sign in to comment.