diff options
| author | Bernard Xiong <[email protected]> | 2015-10-14 14:48:22 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2015-10-14 14:48:22 +0800 |
| commit | 402732ebb92f5b555aff1bf2b4e877007f528d54 (patch) | |
| tree | 96ef6f2dcfc1e10e3a91cde98e31593ac60b3672 /tools/building.py | |
| parent | 369557a981ec0d4928357b62a7559d51d340a1d6 (diff) | |
| parent | c5fd1aaf5f89e6bcafc620c4dc7be5cb2f42d6d5 (diff) | |
Merge branch 'master' of https://github.com/RT-Thread/rt-thread
Diffstat (limited to 'tools/building.py')
| -rw-r--r-- | tools/building.py | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/tools/building.py b/tools/building.py index 5ad6d4e9d2..07f5e91fc9 100644 --- a/tools/building.py +++ b/tools/building.py @@ -267,6 +267,12 @@ def PrepareModuleBuilding(env, root_directory, bsp_directory): global Env global Rtt_Root + # patch for win32 spawn + if env['PLATFORM'] == 'win32': + win32_spawn = Win32Spawn() + win32_spawn.env = env + env['SPAWN'] = win32_spawn.spawn + Env = env Rtt_Root = root_directory @@ -491,37 +497,35 @@ def DoBuilding(target, objects): lst.append(item) return lst - objects = one_list(objects) - - # remove source files with local flags setting - for group in Projects: - if group.has_key('LOCAL_CCFLAGS') or group.has_key('LOCAL_CPPPATH') or group.has_key('LOCAL_CPPDEFINES'): - for source in group['src']: - for obj in objects: - if source.abspath == obj.abspath or (len(obj.sources) > 0 and source.abspath == obj.sources[0].abspath): - objects.remove(obj) - - # re-add the source files to the objects - for group in Projects: + # handle local group + def local_group(group, objects): if group.has_key('LOCAL_CCFLAGS') or group.has_key('LOCAL_CPPPATH') or group.has_key('LOCAL_CPPDEFINES'): CCFLAGS = Env.get('CCFLAGS', '') + group.get('LOCAL_CCFLAGS', '') CPPPATH = Env.get('CPPPATH', ['']) + group.get('LOCAL_CPPPATH', ['']) CPPDEFINES = Env.get('CPPDEFINES', ['']) + group.get('LOCAL_CPPDEFINES', ['']) for source in group['src']: - objects += Env.Object(source, CCFLAGS = CCFLAGS, - CPPPATH = CPPPATH, - CPPDEFINES = CPPDEFINES) + objects.append(Env.Object(source, CCFLAGS = CCFLAGS, + CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)) + + return True + + return False + + objects = one_list(objects) program = None # check whether special buildlib option lib_name = GetOption('buildlib') if lib_name: + objects = [] # remove all of objects # build library with special component for Group in Projects: if Group['name'] == lib_name: lib_name = GroupLibName(Group['name'], Env) - objects = Env.Object(Group['src']) + if not local_group(Group, objects): + objects = Env.Object(Group['src']) + program = Env.Library(lib_name, objects) # add library copy action @@ -529,6 +533,18 @@ def DoBuilding(target, objects): break else: + # remove source files with local flags setting + for group in Projects: + if group.has_key('LOCAL_CCFLAGS') or group.has_key('LOCAL_CPPPATH') or group.has_key('LOCAL_CPPDEFINES'): + for source in group['src']: + for obj in objects: + if source.abspath == obj.abspath or (len(obj.sources) > 0 and source.abspath == obj.sources[0].abspath): + objects.remove(obj) + + # re-add the source files to the objects + for group in Projects: + local_group(group, objects) + program = Env.Program(target, objects) EndBuilding(target, program) |
