diff options
| author | JasonJiaJie <[email protected]> | 2017-11-14 17:04:22 +0800 |
|---|---|---|
| committer | JasonJiaJie <[email protected]> | 2017-11-14 17:04:22 +0800 |
| commit | 83b9c7392c678b2bceba2f99438e06d0f3e2c55a (patch) | |
| tree | 448b3ff41b0543070643b87f145c8891f069100e /tools | |
| parent | 4eb8121bae6b25f7d9cd1cf83f2a609f5ec96a94 (diff) | |
| parent | 543a83eb01ae617a97f1b6d580e179fa4ea40dcf (diff) | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/building.py | 1 | ||||
| -rw-r--r-- | tools/iar.py | 33 |
2 files changed, 29 insertions, 5 deletions
diff --git a/tools/building.py b/tools/building.py index ff8f289e13..d4f6b42129 100644 --- a/tools/building.py +++ b/tools/building.py @@ -30,6 +30,7 @@ import string from SCons.Script import * from utils import _make_path_relative +from mkdist import do_copy_file BuildOptions = {} Projects = [] diff --git a/tools/iar.py b/tools/iar.py index 115ac72911..b5a012e4c5 100644 --- a/tools/iar.py +++ b/tools/iar.py @@ -86,6 +86,7 @@ def IARProject(target, script): CPPDEFINES = [] LINKFLAGS = '' CCFLAGS = '' + Libs = [] # add group for group in script: @@ -102,19 +103,32 @@ def IARProject(target, script): # get each group's link flags if group.has_key('LINKFLAGS') and group['LINKFLAGS']: LINKFLAGS += group['LINKFLAGS'] - + + if group.has_key('LIBS') and group['LIBS']: + for item in group['LIBS']: + lib_path = '' + + for path_item in group['LIBPATH']: + full_path = os.path.join(path_item, item + '.a') + if os.path.isfile(full_path): # has this library + lib_path = full_path + + if lib_path != '': + lib_path = _make_path_relative(project_path, lib_path) + Libs += [lib_path] + # make relative path paths = set() for path in CPPPATH: inc = _make_path_relative(project_path, os.path.normpath(path)) paths.add(inc) #.replace('\\', '/') - + # setting options options = tree.findall('configuration/settings/data/option') for option in options: # print option.text name = option.find('name') - + if name.text == 'CCIncludePath2' or name.text == 'newCCIncludePaths': for path in paths: state = SubElement(option, 'state') @@ -127,9 +141,18 @@ def IARProject(target, script): for define in CPPDEFINES: state = SubElement(option, 'state') state.text = define - + + if name.text == 'IlinkAdditionalLibs': + for path in Libs: + state = SubElement(option, 'state') + if os.path.isabs(path) or path.startswith('$'): + path = path.decode(fs_encoding) + else: + path = ('$PROJ_DIR$\\' + path).decode(fs_encoding) + state.text = path + xml_indent(root) out.write(etree.tostring(root, encoding='utf-8')) out.close() - + IARWorkspace(target) |
