Skip to content

Commit

Permalink
fix some issue with IAR
Browse files Browse the repository at this point in the history
  • Loading branch information
tianxiaoMCU committed Jul 13, 2018
1 parent 21a5dd0 commit 2260486
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions si4project_filelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
if os.path.exists(depfilename):
sourcefile = depfilename
outputfile = os.path.splitext(projectfilename)[0]

# find current target
wsdtfile = os.path.join(os.getcwd(), 'settings')
wsdtfile = os.path.join(wsdtfile, entry.name.replace('.eww', '.wsdt'))

if os.path.exists(wsdtfile):
tree = ET.ElementTree(file=wsdtfile)
ConfigDictionary = tree.find('ConfigDictionary')
CurrentConfigs = ConfigDictionary.find('CurrentConfigs')
TargetName = CurrentConfigs.find('Project').text.split('/')[1]
break
else:
print('Please build the project once')
Expand Down Expand Up @@ -95,11 +105,9 @@
if TargetName == tag.find('name').text:
output_tag = tag.find('outputs')

for elem in output_tag.iterfind('file'):
for elem in output_tag.findall('file'):
if elem.text.startswith('$PROJ_DIR$'):
if elem.text.endswith('.c'):
si4filelist.append(os.path.abspath(elem.text.replace('$PROJ_DIR$', os.getcwd()))+'\n')
elif elem.text.endswith('.h'):
if elem.text.endswith('.c') or elem.text.endswith('.s') or elem.text.endswith('.h'):
si4filelist.append(os.path.abspath(elem.text.replace('$PROJ_DIR$', os.getcwd()))+'\n')
break

Expand Down

0 comments on commit 2260486

Please sign in to comment.