Skip to content

Commit 40c4aec

Browse files
committed
Merge pull request #549 from 0xc0170/fix_iar_template
Exporters: IAR template - files and targets fix
2 parents fb8255b + 3b87e28 commit 40c4aec

File tree

4 files changed

+3674
-3
lines changed

4 files changed

+3674
-3
lines changed

workspace_tools/export/iar.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,20 @@ class IAREmbeddedWorkbench(Exporter):
2828
]
2929

3030
def generate(self):
31+
32+
sources = []
33+
sources += self.resources.c_sources
34+
sources += self.resources.cpp_sources
35+
sources += self.resources.s_sources
36+
3137
ctx = {
3238
'name': self.program_name,
3339
'include_paths': self.resources.inc_dirs,
3440
'linker_script': self.resources.linker_script,
3541
'object_files': self.resources.objects,
3642
'libraries': self.resources.libraries,
37-
'symbols': self.toolchain.get_symbols()
43+
'symbols': self.toolchain.get_symbols(),
44+
'source_files': sources,
3845
}
39-
self.gen_file('iar.ewp.tmpl', ctx, '%s.ewp' % self.program_name)
46+
self.gen_file('iar_%s.ewp.tmpl' % self.target.lower(), ctx, '%s.ewp' % self.program_name)
4047
self.gen_file('iar.eww.tmpl', ctx, '%s.eww' % self.program_name)

workspace_tools/export/iar.ewp.tmpl renamed to workspace_tools/export/iar_arch_pro.ewp.tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1821,9 +1821,11 @@
18211821
<data/>
18221822
</settings>
18231823
</configuration>
1824+
{% for files in source_files %}
18241825
<file>
1825-
<name>$PROJ_DIR$\main.cpp</name>
1826+
<name>$PROJ_DIR$\{{files}}</name>
18261827
</file>
1828+
{% endfor %}
18271829
</project>
18281830

18291831

0 commit comments

Comments
 (0)