Skip to content

Commit

Permalink
Merge pull request #69294 from akien-mga/windows-msvc-link-debug-runtime
Browse files Browse the repository at this point in the history
Windows: Link MSVC dynamic debug CRT for debug builds
  • Loading branch information
akien-mga committed Dec 5, 2022
2 parents 8ff2ca3 + cf9bb5c commit e82d66f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions platform/windows/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e82d66f

Please sign in to comment.