Windows: Make MSVC debug CRT opt-in (debug_crt=yes)

Follow-up to #69294 which enabled it automatically for `dev_build=yes`,
but this seems to cause some issues.
Those issues should likely be debugged but until then this can stay opt-in.
This commit is contained in:
Rémi Verschelde 2022-12-05 15:56:04 +01:00
parent d759210f52
commit 5c6e2b2cac
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -188,6 +188,7 @@ def get_opts():
BoolVariable("use_llvm", "Use the LLVM compiler", False),
BoolVariable("use_static_cpp", "Link MinGW/MSVC C++ runtime libraries statically", True),
BoolVariable("use_asan", "Use address sanitizer (ASAN)", False),
BoolVariable("debug_crt", "Compile with MSVC's debug CRT (/MDd)", False),
]
@ -339,7 +340,7 @@ def configure_msvc(env, vcvars_msvc_config):
## Compile/link flags
if env["optimize"] in ["debug", "none"]:
if env["debug_crt"]:
# Always use dynamic runtime, static debug CRT breaks thread_local.
env.AppendUnique(CCFLAGS=["/MDd"])
else: