未验证 提交 70d6d367 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #2952 from armink/fix_eclipse

Fix eclipse
...@@ -181,6 +181,7 @@ def HandleToolOption(tools, env, project, reset): ...@@ -181,6 +181,7 @@ def HandleToolOption(tools, env, project, reset):
if tool.get('id').find('c.linker') != -1: if tool.get('id').find('c.linker') != -1:
options = tool.findall('option') options = tool.findall('option')
for option in options: for option in options:
# update linker script config
if option.get('id').find('c.linker.scriptfile') != -1: if option.get('id').find('c.linker.scriptfile') != -1:
linker_script = 'link.lds' linker_script = 'link.lds'
items = env['LINKFLAGS'].split(' ') items = env['LINKFLAGS'].split(' ')
...@@ -201,12 +202,31 @@ def HandleToolOption(tools, env, project, reset): ...@@ -201,12 +202,31 @@ def HandleToolOption(tools, env, project, reset):
linker_script = ConverToEclipsePathFormat(items[items.index('-T') + 1]).strip('"') linker_script = ConverToEclipsePathFormat(items[items.index('-T') + 1]).strip('"')
option.set('value',linker_script) option.set('value',linker_script)
# update nostartfiles config
if option.get('id').find('c.linker.nostart') != -1: if option.get('id').find('c.linker.nostart') != -1:
if env['LINKFLAGS'].find('-nostartfiles') != -1: if env['LINKFLAGS'].find('-nostartfiles') != -1:
option.set('value', 'true') option.set('value', 'true')
else: else:
option.set('value', 'false') 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})
# update lib paths
if option.get('id').find('c.linker.paths') != -1 and env.has_key('LIBPATH'):
# remove old lib paths
for item in option.findall('listOptionValue'):
option.remove(item)
# add new old lib paths
for path in env['LIBPATH']:
SubElement(option, 'listOptionValue', {'builtIn': 'false', 'value': path})
return return
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册