summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-11-19 18:10:39 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-11-21 11:04:10 +0100
commitedf02f83194b58408ca241459c986e32c52fd9c7 (patch)
treeb2557429d8013d3e21bc5ff268e6bc76330d7af8 /tools
parent6c2f9196d76b81de0ea0ff7480767c4c34336882 (diff)
downloadredot-cpp-edf02f83194b58408ca241459c986e32c52fd9c7.tar.gz
[SCons] Link MSVC debug runtime for optimize=none|debug only.
Select windows runtime in "targets" tool, use "/MDd" flag only when building with optimize="none" and optimize="debug".
Diffstat (limited to 'tools')
-rw-r--r--tools/targets.py10
-rw-r--r--tools/windows.py4
2 files changed, 7 insertions, 7 deletions
diff --git a/tools/targets.py b/tools/targets.py
index b3d1c52..e9857dd 100644
--- a/tools/targets.py
+++ b/tools/targets.py
@@ -55,7 +55,7 @@ def generate(env):
env["optimize"] = ARGUMENTS.get("optimize", opt_level)
env["debug_symbols"] = get_cmdline_bool("debug_symbols", env.dev_build)
- if "is_msvc" in env and env["is_msvc"]:
+ if env.get("is_msvc", False):
if env["debug_symbols"]:
env.Append(CCFLAGS=["/Zi", "/FS"])
env.Append(LINKFLAGS=["/DEBUG:FULL"])
@@ -66,8 +66,12 @@ def generate(env):
elif env["optimize"] == "size":
env.Append(CCFLAGS=["/O1"])
env.Append(LINKFLAGS=["/OPT:REF"])
- elif env["optimize"] == "debug" or env["optimize"] == "none":
- env.Append(CCFLAGS=["/Od"])
+
+ if env["optimize"] == "debug" or env["optimize"] == "none":
+ env.Append(CCFLAGS=["/MDd", "/Od"])
+ else:
+ env.Append(CCFLAGS=["/MD"])
+
else:
if env["debug_symbols"]:
if env.dev_build:
diff --git a/tools/windows.py b/tools/windows.py
index 2983f50..16acc28 100644
--- a/tools/windows.py
+++ b/tools/windows.py
@@ -27,10 +27,6 @@ def generate(env):
env.Append(CPPDEFINES=["TYPED_METHOD_BIND", "NOMINMAX"])
env.Append(CCFLAGS=["/EHsc"])
env.Append(LINKFLAGS=["/WX"])
- if env["debug_symbols"] or env["target"] == "debug":
- env.Append(CCFLAGS=["/MDd"])
- else:
- env.Append(CCFLAGS=["/MD"])
if env["use_clang_cl"]:
env["CC"] = "clang-cl"