Skip to content

Commit 8d6982b

Browse files
committed
[SCons] Platform agnostic default toolchain (GNU).
Create the SCons Environment with an empty PLATFORM variable to force the default tools to use the GNU toolchain. Platform specific toolchains are then setup in our custom tools.
1 parent 104997e commit 8d6982b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

SConstruct

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ elif ARGUMENTS.get("platform", ""):
2828
else:
2929
raise ValueError("Could not detect platform automatically, please specify with platform=<platform>")
3030

31-
env = Environment(tools=["default"])
31+
# Default tools with no platform defaults to gnu toolchain.
32+
# We apply platform specific toolchains via our custom tools.
33+
env = Environment(tools=["default"], PLATFORM="")
3234

3335
# Default num_jobs to local cpu count if not user specified.
3436
# SCons has a peculiarity where user-specified options won't be overridden

tools/windows.py

+5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ def generate(env):
2323
elif env["arch"] == "x86_32":
2424
env["TARGET_ARCH"] = "x86"
2525
env["is_msvc"] = True
26+
27+
# MSVC, linker, and archiver.
2628
msvc.generate(env)
29+
env.Tool("mslib")
30+
env.Tool("mslink")
31+
2732
env.Append(CPPDEFINES=["TYPED_METHOD_BIND", "NOMINMAX"])
2833
env.Append(CCFLAGS=["/EHsc"])
2934
env.Append(LINKFLAGS=["/WX"])

0 commit comments

Comments
 (0)