diff options
| author | Bernard Xiong <[email protected]> | 2014-02-16 16:36:54 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2014-02-16 16:36:54 +0800 |
| commit | fd4554392a6f8011c681a56e44dc116d0906d927 (patch) | |
| tree | 292f7d7ea631de3c29efd37bab7a7a8ca1581edd /tools | |
| parent | fb6b1c2520c5275da9f2ca2859be53cb1da89f66 (diff) | |
[scons] Use a single path for group (ci build)
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/building.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tools/building.py b/tools/building.py index ff75e6f339..00ef97c4b0 100644 --- a/tools/building.py +++ b/tools/building.py @@ -284,14 +284,27 @@ def MergeGroup(src_group, group): else: src_group['LIBPATH'] = group['LIBPATH'] + if src_group.has_key('LIBS'): + print src_group['LIBS'] + if src_group.has_key('LIBS'): + print src_group['LIBPATH'] + def DefineGroup(name, src, depend, **parameters): global Env if not GetDepend(depend): return [] + # find exist group and get path of group + group_path = '' + for g in Projects: + if g['name'] == name: + group_path = g['path'] + if group_path == '': + group_path = GetCurrentDir() + group = parameters group['name'] = name - group['path'] = GetCurrentDir() + group['path'] = group_path if type(src) == type(['src1']): group['src'] = File(src) else: @@ -396,6 +409,12 @@ def DoBuilding(target, objects): break else: + # merge the repeated items in the Env + if Env.has_key('CPPPATH') : Env['CPPPATH'] = list(set(Env['CPPPATH'])) + if Env.has_key('CPPDEFINES'): Env['CPPDEFINES'] = list(set(Env['CPPDEFINES'])) + if Env.has_key('LIBPATH') : Env['LIBPATH'] = list(set(Env['LIBPATH'])) + if Env.has_key('LIBS') : Env['LIBS'] = list(set(Env['LIBS'])) + program = Env.Program(target, objects) EndBuilding(target, program) @@ -500,6 +519,9 @@ def GlobSubDir(sub_dir, ext_name): dst.append(os.path.relpath(item, sub_dir)) return dst +def file_path_exist(path, *args): + return os.path.exists(os.path.join(path, *args)) + def do_rm_file(src): if os.path.exists(src): os.unlink(src) |
