Browse Source

Support debug_symbols in VS optimized builds

elasota 7 years ago
parent
commit
ffe0235f62
1 changed files with 6 additions and 0 deletions
  1. 6 0
      platform/windows/detect.py

+ 6 - 0
platform/windows/detect.py

@@ -172,6 +172,7 @@ def configure_msvc(env, manual_msvc_config):
             env.Append(CCFLAGS=['/O1'])
             env.Append(CCFLAGS=['/O1'])
         env.Append(LINKFLAGS=['/SUBSYSTEM:WINDOWS'])
         env.Append(LINKFLAGS=['/SUBSYSTEM:WINDOWS'])
         env.Append(LINKFLAGS=['/ENTRY:mainCRTStartup'])
         env.Append(LINKFLAGS=['/ENTRY:mainCRTStartup'])
+        env.Append(LINKFLAGS=['/OPT:REF'])
 
 
     elif (env["target"] == "release_debug"):
     elif (env["target"] == "release_debug"):
         if (env["optimize"] == "speed"): #optimize for speed (default)
         if (env["optimize"] == "speed"): #optimize for speed (default)
@@ -180,6 +181,7 @@ def configure_msvc(env, manual_msvc_config):
             env.Append(CCFLAGS=['/O1'])
             env.Append(CCFLAGS=['/O1'])
         env.AppendUnique(CPPDEFINES = ['DEBUG_ENABLED'])
         env.AppendUnique(CPPDEFINES = ['DEBUG_ENABLED'])
         env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE'])
         env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE'])
+        env.Append(LINKFLAGS=['/OPT:REF'])
 
 
     elif (env["target"] == "debug_release"):
     elif (env["target"] == "debug_release"):
         env.Append(CCFLAGS=['/Z7', '/Od'])
         env.Append(CCFLAGS=['/Z7', '/Od'])
@@ -194,6 +196,10 @@ def configure_msvc(env, manual_msvc_config):
         env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE'])
         env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE'])
         env.Append(LINKFLAGS=['/DEBUG'])
         env.Append(LINKFLAGS=['/DEBUG'])
 
 
+    if (env["debug_symbols"] == "full" or env["debug_symbols"] == "yes"):
+        env.AppendUnique(CCFLAGS=['/Z7'])
+        env.AppendUnique(LINKFLAGS=['/DEBUG'])
+
     ## Compile/link flags
     ## Compile/link flags
 
 
     env.AppendUnique(CCFLAGS=['/MT', '/Gd', '/GR', '/nologo'])
     env.AppendUnique(CCFLAGS=['/MT', '/Gd', '/GR', '/nologo'])