Skip to content

Commit

Permalink
Requested changes and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Emilien Bauer committed Sep 19, 2022
1 parent 472d6b3 commit 2cbabef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ from binding_generator import scons_generate_bindings, scons_emit_files

EnsureSConsVersion(4, 0)


def add_sources(sources, dir, extension):
for f in os.listdir(dir):
if f.endswith("." + extension):
Expand Down Expand Up @@ -59,9 +60,6 @@ opts.Add(
)
)

opts.Add(BoolVariable("cache", "Cache results for faster iteration when develloping.", False))
opts.Add(PathVariable("cache_dir", "Where you want your cache directory.", "cache", PathVariable.PathIsDirCreate))

# Must be the same setting as used for cpp_bindings
opts.Add(EnumVariable("target", "Compilation target", "debug", allowed_values=("debug", "release"), ignorecase=2))
opts.Add(
Expand Down Expand Up @@ -170,12 +168,14 @@ else:
json_api_file = os.path.join(os.getcwd(), env["headers_dir"], "extension_api.json")

bindings = env.GenerateBindings(
env.Dir("."), [json_api_file, os.path.join(env["headers_dir"], "godot", "gdnative_interface.h"), "binding_generator.py"]
env.Dir("."),
[json_api_file, os.path.join(env["headers_dir"], "godot", "gdnative_interface.h"), "binding_generator.py"]
)

if(env["cache"]):
CacheDir(env["cache_dir"])
Decider('MD5')
scons_cache_path = os.environ.get("SCONS_CACHE")
if scons_cache_path is not None:
CacheDir(scons_cache_path)
Decider("MD5")

# Forces bindings regeneration.
if env["generate_bindings"]:
Expand Down
4 changes: 2 additions & 2 deletions binding_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def generate_builtin_bindings(api, output_dir, build_config):
for type_name in fully_used_classes:
if type_name in used_classes:
used_classes.remove(type_name)

used_classes = list(used_classes)
used_classes.sort()
fully_used_classes = list(fully_used_classes)
Expand Down Expand Up @@ -892,7 +892,7 @@ def generate_engine_classes_bindings(api, output_dir, use_template_get_node):
for type_name in fully_used_classes:
if type_name in used_classes:
used_classes.remove(type_name)

used_classes = list(used_classes)
used_classes.sort()
fully_used_classes = list(fully_used_classes)
Expand Down

0 comments on commit 2cbabef

Please sign in to comment.