Skip to content

Commit 85ebdbe

Browse files
committed
added ability to manually set compiler tools
1 parent 8e88123 commit 85ebdbe

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

SConstruct

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,29 @@ opts.Add(
110110
map=architecture_aliases,
111111
)
112112
)
113+
opts.Add(
114+
BoolVariable(
115+
key="platform_tools",
116+
help="If true, auto detect platform build tools and override ones passed in via CC, CXX, RC, etc.",
117+
default=False,
118+
)
119+
)
113120

121+
opts.Add("CXX", "C++ compiler binary")
122+
opts.Add("CC", "C compiler binary")
123+
opts.Add("LINK", "Linker binary")
124+
opts.Add("AS", "Assembler binary")
125+
opts.Add("AR", "Archiver binary")
126+
opts.Add("RANLIB", "Ranlib binary")
127+
opts.Add("RC", "Resource compiler binary")
114128
opts.Add("cppdefines", "Custom defines for the pre-processor")
115129
opts.Add("ccflags", "Custom flags for both the C and C++ compilers")
116130
opts.Add("cxxflags", "Custom flags for the C++ compiler")
117131
opts.Add("cflags", "Custom flags for the C compiler")
118132
opts.Add("linkflags", "Custom flags for the linker")
119133
opts.Add("extra_suffix", "Custom extra suffix added to the base filename of all generated binary files.", "")
120134
opts.Add(BoolVariable("use_asan", "Use address sanitizer (ASAN) in MSVC", False))
135+
opts.Add("import_env_vars", "A comma-separated list of environment variables to copy from the outer environment.", "")
121136

122137
# Targets flags tool (optimizations, debug symbols)
123138
target_tool = Tool("targets", toolpath=["godot-tools"])
@@ -126,6 +141,12 @@ target_tool.options(opts)
126141
opts.Update(env)
127142
Help(opts.GenerateHelpText(env))
128143

144+
# Copy custom environment variables if set.
145+
if env["import_env_vars"]:
146+
for env_var in str(env["import_env_vars"]).split(","):
147+
if env_var in os.environ:
148+
env["ENV"][env_var] = os.environ[env_var]
149+
129150
# Process CPU architecture argument.
130151
if env["arch"] == "":
131152
# No architecture specified. Default to arm64 if building for Android,

0 commit comments

Comments
 (0)