From d3c0e236f23e66cb2b4a75f5161282b2d15ff73f Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 14 Apr 2014 14:31:02 +0100 Subject: scons: Add an analyze option. For Clang static code analyzer, the scan-build script will produce more comprehensive output. Nevertheless you can invoke it as CC=clang CXX=clang++ scons analyze=1 For MSVC this is the best way to use its static code analysis. Simply invoke as scons analyze=1 Reviewed-by: Brian Paul --- scons/gallium.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'scons/gallium.py') 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': -- cgit v1.2.3