diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-05 10:14:33 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-05 10:14:33 +0100 |
commit | e82d66f23b987f9380b666179f25b44813509106 (patch) | |
tree | 3ff806e459e737f189f71d74323092217f51d0c4 /platform | |
parent | 8ff2ca35c55d3cce73abc4f9e4c085eeb32343c4 (diff) | |
parent | cf9bb5c2c3939790ee9c5de159d140f815fa1010 (diff) |
Merge pull request #69294 from akien-mga/windows-msvc-link-debug-runtime
Windows: Link MSVC dynamic debug CRT for debug builds
Diffstat (limited to 'platform')
-rw-r--r-- | platform/windows/detect.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 705e83dace..2b1ed64f4a 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -339,10 +339,14 @@ def configure_msvc(env, vcvars_msvc_config): ## Compile/link flags - if env["use_static_cpp"]: - env.AppendUnique(CCFLAGS=["/MT"]) + if env["optimize"] in ["debug", "none"]: + # Always use dynamic runtime, static debug CRT breaks thread_local. + env.AppendUnique(CCFLAGS=["/MDd"]) else: - env.AppendUnique(CCFLAGS=["/MD"]) + if env["use_static_cpp"]: + env.AppendUnique(CCFLAGS=["/MT"]) + else: + env.AppendUnique(CCFLAGS=["/MD"]) if env["arch"] == "x86_32": env["x86_libtheora_opt_vc"] = True |