From d65aa2814b732e5e3c76aa2aa368209cd2d04aa4 Mon Sep 17 00:00:00 2001 From: crashfort Date: Sat, 25 Nov 2023 23:45:10 +0100 Subject: [PATCH] Fix wrong build options for MSVC --- tools/windows.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/windows.py b/tools/windows.py index d5a729c5..8193578e 100644 --- a/tools/windows.py +++ b/tools/windows.py @@ -38,10 +38,16 @@ def generate(env): env["CC"] = "clang-cl" env["CXX"] = "clang-cl" - if env["use_static_cpp"]: - env.Append(CCFLAGS=["/MT"]) + if env["optimize"] == "debug" or env["optimize"] == "none": + if env["use_static_cpp"]: + env.Append(CCFLAGS=["/MTd"]) + else: + env.Append(CCFLAGS=["/MDd"]) else: - env.Append(CCFLAGS=["/MD"]) + if env["use_static_cpp"]: + env.Append(CCFLAGS=["/MT"]) + else: + env.Append(CCFLAGS=["/MD"]) elif sys.platform == "win32" or sys.platform == "msys": env["use_mingw"] = True