Merge pull request #69294 from akien-mga/windows-msvc-link-debug-runtime

Windows: Link MSVC dynamic debug CRT for debug builds
This commit is contained in:
Rémi Verschelde 2022-12-05 10:14:33 +01:00
commit e82d66f23b
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 7 additions and 3 deletions

View File

@ -339,6 +339,10 @@ def configure_msvc(env, vcvars_msvc_config):
## Compile/link flags ## Compile/link flags
if env["optimize"] in ["debug", "none"]:
# Always use dynamic runtime, static debug CRT breaks thread_local.
env.AppendUnique(CCFLAGS=["/MDd"])
else:
if env["use_static_cpp"]: if env["use_static_cpp"]:
env.AppendUnique(CCFLAGS=["/MT"]) env.AppendUnique(CCFLAGS=["/MT"])
else: else: