From 35cac170fa0cf6829afda14ecc124b20bce2b061 Mon Sep 17 00:00:00 2001 From: Grissiom Date: Sat, 7 Sep 2013 15:01:28 +0800 Subject: [PATCH] simulator: add clang-analyze tool support When CROSS_TOOL or 'RTT_CC' env is setted to 'clang-analyze', it will use Clang to check the codes. --- bsp/simulator/SConstruct | 4 ++++ bsp/simulator/rtconfig.py | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bsp/simulator/SConstruct b/bsp/simulator/SConstruct index b2e958e65..4db7328f2 100755 --- a/bsp/simulator/SConstruct +++ b/bsp/simulator/SConstruct @@ -73,6 +73,10 @@ elif rtconfig.PLATFORM == 'mingw': LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS) env['LIBS']=libs env.PrependENVPath('PATH', rtconfig.EXEC_PATH) +elif rtconfig.CROSS_TOOL == 'clang-analyze': + TARGET = 'rtthread' + env = Environment(toolpath=[os.path.join(RTT_ROOT, 'tools', 'tools')], + tools = [rtconfig.CROSS_TOOL]) else: TARGET = 'rtthread' env['CC']=rtconfig.CC diff --git a/bsp/simulator/rtconfig.py b/bsp/simulator/rtconfig.py index 9328a087f..d3ed2599d 100755 --- a/bsp/simulator/rtconfig.py +++ b/bsp/simulator/rtconfig.py @@ -12,10 +12,10 @@ if os.getenv('RTT_CC'): # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute path -if CROSS_TOOL == 'gcc': +if CROSS_TOOL == 'gcc' or CROSS_TOOL == 'clang-analyze': CPU = 'posix' PLATFORM = 'gcc' - EXEC_PATH = '/usr/bin/gcc' + EXEC_PATH = '' elif CROSS_TOOL == 'mingw': CPU = 'win32' @@ -26,8 +26,7 @@ elif CROSS_TOOL == 'msvc': CPU = 'win32' PLATFORM = 'cl' EXEC_PATH = '' - -else : +else: print "bad CROSS TOOL!" exit(1) -- GitLab