Skip to content

Commit

Permalink
removed gdnative_ from method names
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriySalnikov committed Jul 20, 2023
1 parent 0a08cd3 commit 0d45f2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

import lib_utils
env = SConscript("godot-cpp/SConstruct")
new_env = lib_utils.gdnative_get_library_object(env.Clone(), ARGUMENTS, lambda e, o: Help(o.GenerateHelpText(e)))
new_env = lib_utils.get_library_object(env.Clone(), ARGUMENTS, lambda e, o: Help(o.GenerateHelpText(e)))
Return("new_env")
14 changes: 7 additions & 7 deletions lib_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def setup_options(env, arguments, gen_help):
gen_help(env, opts)


def gdnative_setup_defines_and_flags(env):
def setup_defines_and_flags(env):
env.Append(CPPDEFINES=["GDEXTENSION_LIBRARY"])

if "release" in env["target"] and not env["force_enabled_dd3d"]:
Expand All @@ -38,27 +38,27 @@ def gdnative_setup_defines_and_flags(env):
env.AppendUnique(LINKFLAGS=["-flto"])


def gdnative_get_sources(src):
def get_sources(src):
res = [src_folder + "/" + file for file in src]
res = unity_tools.generate_unity_build(res, "dd3d_")

return res


def gdnative_replace_flag(arr, flag, new_flag):
def replace_flag(arr, flag, new_flag):
if flag in arr:
arr.remove(flag)
arr.append(new_flag)


def gdnative_get_library_object(env, arguments=None, gen_help=None):
def get_library_object(env, arguments=None, gen_help=None):
if arguments != None and gen_help:
setup_options(env, arguments, gen_help)
gdnative_setup_defines_and_flags(env)
setup_defines_and_flags(env)

env.Append(CPPPATH=[src_folder])

# gdnative_replace_flag(env["CXXFLAGS"], "/std:c++17" if env.get("is_msvc", False) else "-std=c++17",
# replace_flag(env["CXXFLAGS"], "/std:c++17" if env.get("is_msvc", False) else "-std=c++17",
# "/std:c++20" if env.get("is_msvc", False) else "-std=c++20")

src = []
Expand All @@ -78,7 +78,7 @@ def gdnative_get_library_object(env, arguments=None, gen_help=None):

env.Default(env.SharedLibrary(
target=env.File(Path(env["addon_output_dir"]) / library_full_name),
source=gdnative_get_sources(src),
source=get_sources(src),
SHLIBSUFFIX=env["SHLIBSUFFIX"]
))

Expand Down

0 comments on commit 0d45f2e

Please sign in to comment.