If the src is empty list, it will crash at:
IndexError: list index out of range:
File "/home/xxx/src/SConstruct", line 39:
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=True)
...
File "/home/xxx/src/drivers/SConscript", line 12:
SrcRemove(src, src_need_remove)
File "/home/rt-thread-stable/tools/building.py", line 496:
if type(src[0]) == type('str'):
Dict Comprehensions is imported in Python 2.7 & 3.0 which is PEP 274 [1]. Some
OS like CentOS 6 which is use Python 2.6 cannot support this syntex.
[1] http://legacy.python.org/dev/peps/pep-0274/
Signed-off-by: Xiongfei Guo <xfguo@credosemi.com>
The startupinfo does not have any visible effects on the building
process and some old Python version does not have it at all. So remove
it for the seek of simple.
Tested `scons -j4` in a dual core virtual machine.
The order of CPPPATH is important: some project would use the order of
CPPPATH to override the default configuration headers. This commit also
refine the this piece of code in a more Pythonic way.
Windows(tm) CreateProcess does not use the env passed to it to find the
executables. So we have to modify our own PATH to make Popen work. Also,
detect the cmd build-in commands and execute it directly.
Tested on MDK toolchain on RB4088 and the MSVS toolchain on simulator
BSP.
In SCons manual:
=================
In order to inform the C compiler about the repositories, SCons will
add appropriate -I flags to the compilation commands for each directory
in the $CPPPATH list. So if we add the current directory to the
construction environment $CPPPATH like so:
env = Environment(CPPPATH = ['.'])
env.Program('hello.c')
Repository('/usr/repository1')
Then re-executing SCons yields:
% scons -Q
cc -o hello.o -c -I. -I/usr/repository1 hello.c
cc -o hello hello.o
=================
The additional include directory is definitely not what we want. Just
remove the additional Repository line.
Bsps can use the clang analyzer as a tool:
env = Environment(toolpath=[os.path.join(RTT_ROOT, 'tools',
'tools')], tools = ['clang-analyze'])
When building the project, the static analyzer will be called to check
all the C code. The warnings are print to stderr.