Skip to content

Commit

Permalink
Merge pull request #971 from Faless/build/4.x_default_gnu
Browse files Browse the repository at this point in the history
[SCons] Platform agnostic default toolchain (GNU).
  • Loading branch information
akien-mga authored Dec 20, 2022
2 parents 104997e + 8d6982b commit 99de0a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ elif ARGUMENTS.get("platform", ""):
else:
raise ValueError("Could not detect platform automatically, please specify with platform=<platform>")

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

# Default num_jobs to local cpu count if not user specified.
# SCons has a peculiarity where user-specified options won't be overridden
Expand Down
5 changes: 5 additions & 0 deletions tools/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ def generate(env):
elif env["arch"] == "x86_32":
env["TARGET_ARCH"] = "x86"
env["is_msvc"] = True

# MSVC, linker, and archiver.
msvc.generate(env)
env.Tool("mslib")
env.Tool("mslink")

env.Append(CPPDEFINES=["TYPED_METHOD_BIND", "NOMINMAX"])
env.Append(CCFLAGS=["/EHsc"])
env.Append(LINKFLAGS=["/WX"])
Expand Down

0 comments on commit 99de0a8

Please sign in to comment.