Merge 35905b11f3
into 0145e900f3
commit
af48464341
17
SConstruct
17
SConstruct
|
@ -21,16 +21,15 @@ env.PrependENVPath("PATH", os.getenv("PATH"))
|
||||||
|
|
||||||
# Custom options and profile flags.
|
# Custom options and profile flags.
|
||||||
customs = ["custom.py"]
|
customs = ["custom.py"]
|
||||||
try:
|
|
||||||
customs += Import("customs")
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
profile = ARGUMENTS.get("profile", "")
|
profile = ARGUMENTS.get("profile", "")
|
||||||
if profile:
|
if profile:
|
||||||
if os.path.isfile(profile):
|
if not profile.endswith('.py'):
|
||||||
customs.append(profile)
|
profile += '.py'
|
||||||
elif os.path.isfile(profile + ".py"):
|
|
||||||
customs.append(profile + ".py")
|
path = str(Entry('#' + profile))
|
||||||
|
|
||||||
|
if (os.path.isfile(path)):
|
||||||
|
customs.append(path)
|
||||||
opts = Variables(customs, ARGUMENTS)
|
opts = Variables(customs, ARGUMENTS)
|
||||||
cpp_tool = Tool("godotcpp", toolpath=["tools"])
|
cpp_tool = Tool("godotcpp", toolpath=["tools"])
|
||||||
cpp_tool.options(opts, env)
|
cpp_tool.options(opts, env)
|
||||||
|
@ -39,6 +38,8 @@ opts.Update(env)
|
||||||
Help(opts.GenerateHelpText(env))
|
Help(opts.GenerateHelpText(env))
|
||||||
|
|
||||||
# Detect and print a warning listing unknown SCons variables to ease troubleshooting.
|
# Detect and print a warning listing unknown SCons variables to ease troubleshooting.
|
||||||
|
# But only do that if this is top level SConstruct, not subsidiary
|
||||||
|
if Dir("#").abspath == Dir(".").abspath:
|
||||||
unknown = opts.UnknownVariables()
|
unknown = opts.UnknownVariables()
|
||||||
if unknown:
|
if unknown:
|
||||||
print("WARNING: Unknown SCons variables were passed and will be ignored:")
|
print("WARNING: Unknown SCons variables were passed and will be ignored:")
|
||||||
|
|
|
@ -198,6 +198,15 @@ def options(opts, env):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
opts.Add(
|
||||||
|
PathVariable(
|
||||||
|
key="profile",
|
||||||
|
help="Allow specification of customization file other than `custom.py`.",
|
||||||
|
default=env.get("profile", None),
|
||||||
|
validator=validate_file,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
# Add platform options
|
# Add platform options
|
||||||
for pl in platforms:
|
for pl in platforms:
|
||||||
tool = Tool(pl, toolpath=["tools"])
|
tool = Tool(pl, toolpath=["tools"])
|
||||||
|
|
Loading…
Reference in New Issue