Skip to content

Commit

Permalink
Windows: Link MSVC dynamic debug CRT for debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga authored and rohanrhu committed Dec 28, 2022
1 parent 60a843c commit 1d5148b
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 1d5148b

Please sign in to comment.