summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-12-20 15:22:29 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-12-20 17:41:34 +0100
commit8d6982be3be3c4bc0220474a758050bfab9b2ae9 (patch)
tree2f041116cdb783a57449f4dcd9e872c75eff58e6
parent104997e83e304d99e29cccbd2ba26867b18dd190 (diff)
downloadredot-cpp-8d6982be3be3c4bc0220474a758050bfab9b2ae9.tar.gz
[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.
-rw-r--r--SConstruct4
-rw-r--r--tools/windows.py5
2 files changed, 8 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct
index 09a963f..e25dd95 100644
--- a/SConstruct
+++ b/SConstruct
@@ -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
diff --git a/tools/windows.py b/tools/windows.py
index 16acc28..e64695a 100644
--- a/tools/windows.py
+++ b/tools/windows.py
@@ -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"])