summaryrefslogtreecommitdiff
path: root/tools/eclipse.py
diff options
context:
space:
mode:
authorarmink <[email protected]>2019-08-15 10:21:46 +0800
committerarmink <[email protected]>2019-08-15 10:21:46 +0800
commit4e136e4271d6a608e5ddbcda181825c2b38d3748 (patch)
tree1bdad45a891b245436cb33e6d4446698a01ca60c /tools/eclipse.py
parent3b252d5b9721bb7cc649dad832507937efc1e96c (diff)
[tools] Fix eclipse configuration for libs.
Diffstat (limited to 'tools/eclipse.py')
-rw-r--r--tools/eclipse.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/eclipse.py b/tools/eclipse.py
index e4c37892e9..bc4e670e36 100644
--- a/tools/eclipse.py
+++ b/tools/eclipse.py
@@ -181,6 +181,7 @@ def HandleToolOption(tools, env, project, reset):
if tool.get('id').find('c.linker') != -1:
options = tool.findall('option')
for option in options:
+ # update linker script config
if option.get('id').find('c.linker.scriptfile') != -1:
linker_script = 'link.lds'
items = env['LINKFLAGS'].split(' ')
@@ -201,12 +202,22 @@ def HandleToolOption(tools, env, project, reset):
linker_script = ConverToEclipsePathFormat(items[items.index('-T') + 1]).strip('"')
option.set('value',linker_script)
+ # update nostartfiles config
if option.get('id').find('c.linker.nostart') != -1:
if env['LINKFLAGS'].find('-nostartfiles') != -1:
option.set('value', 'true')
else:
option.set('value', 'false')
+ # update libs
+ if option.get('id').find('c.linker.libs') != -1 and env.has_key('LIBS'):
+ # remove old libs
+ for item in option.findall('listOptionValue'):
+ option.remove(item)
+ # add new libs
+ for lib in env['LIBS']:
+ SubElement(option, 'listOptionValue', {'builtIn': 'false', 'value': lib})
+
return