summaryrefslogtreecommitdiffstats
path: root/SConstruct
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2008-02-25 17:55:45 +0900
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2008-02-25 17:55:45 +0900
commitc8b069cc1e839b5dd7a11d33c291b6b587a45df3 (patch)
treee5c69f0a36fe5acd77fa0a0d9bc7d7d02b4028db /SConstruct
parent2d38d1b3005c02273abf3941df5dddc245a6b792 (diff)
Get more debugging info out of MSVC.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct37
1 files changed, 25 insertions, 12 deletions
diff --git a/SConstruct b/SConstruct
index 6d88d52f00d..e4926f29b61 100644
--- a/SConstruct
+++ b/SConstruct
@@ -128,17 +128,6 @@ if platform == 'winddk':
env['WDM_INC_PATH'],
env['CRT_INC_PATH'],
])
-
- env.Append(CFLAGS = '/W3')
- if debug:
- env.Append(CPPDEFINES = [
- ('DBG', '1'),
- ('DEBUG', '1'),
- ('_DEBUG', '1'),
- ])
- env.Append(CFLAGS = '/Od /Zi')
- env.Append(CXXFLAGS = '/Od /Zi')
-
# Optimization flags
if gcc:
@@ -156,10 +145,34 @@ if gcc:
env.Append(CFLAGS = '-fmessage-length=0')
env.Append(CXXFLAGS = '-fmessage-length=0')
+if msvc:
+ env.Append(CFLAGS = '/W3')
+ if debug:
+ cflags = [
+ '/Od', # disable optimizations
+ '/Oy-', # disable frame pointer omission
+ '/Zi', # enable enable debugging information
+ ]
+ else:
+ cflags = [
+ '/Ox', # maximum optimizations
+ '/Os', # favor code space
+ '/Zi', # enable enable debugging information
+ ]
+ env.Append(CFLAGS = cflags)
+ env.Append(CXXFLAGS = cflags)
+
# Defines
if debug:
- env.Append(CPPDEFINES = ['DEBUG'])
+ if gcc:
+ env.Append(CPPDEFINES = ['DEBUG'])
+ if msvc:
+ env.Append(CPPDEFINES = [
+ ('DBG', '1'),
+ ('DEBUG', '1'),
+ ('_DEBUG', '1'),
+ ])
else:
env.Append(CPPDEFINES = ['NDEBUG'])