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.
This commit is contained in:
Grissiom 2013-09-07 15:01:28 +08:00
parent c289aa9fc1
commit 35cac170fa
2 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -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)