add stm32cubeide support

This commit is contained in:
eddylin83 2019-08-05 18:00:20 +08:00
parent 87267b41bc
commit 36d6326732
1 changed files with 9 additions and 2 deletions

View File

@ -138,7 +138,7 @@ def HandleToolOption(tools, env, project, reset):
if tool.get('id').find('c.compile') != 1: if tool.get('id').find('c.compile') != 1:
options = tool.findall('option') options = tool.findall('option')
for option in options: for option in options:
if option.get('id').find('c.compiler.include.paths') != -1: if option.get('id').find('c.compiler.include.paths') != -1 or option.get('id').find('c.compiler.option.includepaths') != -1:
# find all of paths in this project # find all of paths in this project
include_paths = option.findall('listOptionValue') include_paths = option.findall('listOptionValue')
project_paths = [] project_paths = []
@ -159,7 +159,7 @@ def HandleToolOption(tools, env, project, reset):
for item in cproject_paths: for item in cproject_paths:
SubElement(option, 'listOptionValue', {'builtIn': 'false', 'value': item}) SubElement(option, 'listOptionValue', {'builtIn': 'false', 'value': item})
if option.get('id').find('c.compiler.defs') != -1: if option.get('id').find('c.compiler.defs') != -1 or option.get('id').find('c.compiler.option.definedsymbols') != -1:
defs = option.findall('listOptionValue') defs = option.findall('listOptionValue')
project_defs = [] project_defs = []
for item in defs: for item in defs:
@ -194,6 +194,13 @@ def HandleToolOption(tools, env, project, reset):
else: else:
SubElement(option, 'listOptionValue', {'builtIn': 'false', 'value': linker_script}) SubElement(option, 'listOptionValue', {'builtIn': 'false', 'value': linker_script})
# scriptfile in stm32cubeIDE
if option.get('id').find('c.linker.option.script') != -1:
items = env['LINKFLAGS'].split(' ')
if '-T' in items:
linker_script = ConverToEclipsePathFormat(items[items.index('-T') + 1]).strip('"')
option.set('value',linker_script)
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')