summaryrefslogtreecommitdiff
path: root/scons/gallium.py
diff options
context:
space:
mode:
Diffstat (limited to 'scons/gallium.py')
-rwxr-xr-xscons/gallium.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/scons/gallium.py b/scons/gallium.py
index 42e8f7c5476..e873c658ad0 100755
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -467,6 +467,18 @@ def generate(env):
env.Append(CCFLAGS = ['/MT'])
env.Append(SHCCFLAGS = ['/LD'])
+ # Static code analysis
+ if env['analyze']:
+ if env['msvc']:
+ # http://msdn.microsoft.com/en-us/library/ms173498.aspx
+ env.Append(CCFLAGS = [
+ '/analyze',
+ #'/analyze:log', '${TARGET.base}.xml',
+ ])
+ if env['clang']:
+ # scan-build will produce more comprehensive output
+ env.Append(CCFLAGS = ['--analyze'])
+
# Assembler options
if gcc_compat:
if env['machine'] == 'x86':