Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move tools to site_scons/site_tools, which is the canonical scons tools directory. Pass env["toolpath"] down the tool chain in godotcpp.py. #1645

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,16 @@ if profile:
elif os.path.isfile(profile + ".py"):
customs.append(profile + ".py")
opts = Variables(customs, ARGUMENTS)
cpp_tool = Tool("godotcpp", toolpath=["tools"])

# Some environments do not have setdefault yet.
if "toolpath" not in env:
env["toolpath"] = []

# Needed because if we're called as SConscript, our site_tools are not automatically appended to toolpath.
env["toolpath"].append("site_scons/site_tools")

cpp_tool = Tool("godotcpp", toolpath=env["toolpath"])

cpp_tool.options(opts, env)
opts.Update(env)

Expand Down
File renamed without changes.
18 changes: 9 additions & 9 deletions tools/godotcpp.py → site_scons/site_tools/godotcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ def validate_parent_dir(key, val, env):
raise UserError("'%s' is not a directory: %s" % (key, os.path.dirname(val)))


def get_platform_tools_paths(env):
path = env.get("custom_tools", None)
if path is None:
return ["tools"]
return [normalize_path(path, env), "tools"]


def get_custom_platforms(env):
path = env.get("custom_tools", None)
if path is None:
Expand Down Expand Up @@ -189,6 +182,13 @@ def options(opts, env):

opts.Update(env)

# Some environments do not have setdefault yet.
if "toolpath" not in env:
env["toolpath"] = []

if env.get("custom_tools", None) is not None:
env["toolpath"].append(normalize_path(env["custom_tools"], env))

custom_platforms = get_custom_platforms(env)

opts.Add(
Expand Down Expand Up @@ -340,7 +340,7 @@ def options(opts, env):

# Add platform options (custom tools can override platforms)
for pl in sorted(set(platforms + custom_platforms)):
tool = Tool(pl, toolpath=get_platform_tools_paths(env))
tool = Tool(pl, toolpath=env["toolpath"])
if hasattr(tool, "options"):
tool.options(opts)

Expand Down Expand Up @@ -451,7 +451,7 @@ def generate(env):
env["optimize"] = ARGUMENTS.get("optimize", opt_level)
env["debug_symbols"] = get_cmdline_bool("debug_symbols", env.dev_build)

tool = Tool(env["platform"], toolpath=get_platform_tools_paths(env))
tool = Tool(env["platform"], toolpath=env["toolpath"])

if tool is None or not tool.exists(env):
raise ValueError("Required toolchain not found for platform " + env["platform"])
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading