Use /Zi and /FS for including debugger symbols on Windows with MSVC

(cherry picked from commit 4946ae16fc)
This commit is contained in:
Bastiaan Olij 2021-02-09 00:20:42 +11:00 committed by Rémi Verschelde
parent 65a2f0dfd4
commit 6afb9d327e
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -194,13 +194,13 @@ def configure_msvc(env, manual_msvc_config):
env.Append(LINKFLAGS=["/OPT:REF"]) env.Append(LINKFLAGS=["/OPT:REF"])
elif env["target"] == "debug": elif env["target"] == "debug":
env.AppendUnique(CCFLAGS=["/Z7", "/Od", "/EHsc"]) env.AppendUnique(CCFLAGS=["/Zi", "/FS", "/Od", "/EHsc"])
env.AppendUnique(CPPDEFINES=["DEBUG_ENABLED"]) env.AppendUnique(CPPDEFINES=["DEBUG_ENABLED"])
env.Append(LINKFLAGS=["/SUBSYSTEM:CONSOLE"]) env.Append(LINKFLAGS=["/SUBSYSTEM:CONSOLE"])
env.Append(LINKFLAGS=["/DEBUG"]) env.Append(LINKFLAGS=["/DEBUG"])
if env["debug_symbols"]: if env["debug_symbols"]:
env.AppendUnique(CCFLAGS=["/Z7"]) env.AppendUnique(CCFLAGS=["/Zi", "/FS"])
env.AppendUnique(LINKFLAGS=["/DEBUG"]) env.AppendUnique(LINKFLAGS=["/DEBUG"])
## Compile/link flags ## Compile/link flags
@ -209,6 +209,7 @@ def configure_msvc(env, manual_msvc_config):
env.AppendUnique(CCFLAGS=["/MT"]) env.AppendUnique(CCFLAGS=["/MT"])
else: else:
env.AppendUnique(CCFLAGS=["/MD"]) env.AppendUnique(CCFLAGS=["/MD"])
env.AppendUnique(CCFLAGS=["/Gd", "/GR", "/nologo"]) env.AppendUnique(CCFLAGS=["/Gd", "/GR", "/nologo"])
# Force to use Unicode encoding # Force to use Unicode encoding
env.AppendUnique(CCFLAGS=["/utf-8"]) env.AppendUnique(CCFLAGS=["/utf-8"])