pull/7061/head
TTornblom 2018-05-30 17:26:45 +02:00 committed by Jimmy Brisson
parent f3424da060
commit dcd17935e3
3 changed files with 10 additions and 5 deletions

View File

@ -111,6 +111,8 @@ class IAR(Exporter):
self.resources.c_sources + self.resources.cpp_sources + \
self.resources.objects + self.resources.libraries
flags = self.flags
_, macros = self.toolchain.config.get_config_data()
defines = ['-D%s' % d for d in macros] if macros else [""]
c_flags = list(set(flags['common_flags']
+ flags['c_flags']
+ flags['cxx_flags']))
@ -133,7 +135,8 @@ class IAR(Exporter):
'include_paths': [self.format_file(src) for src in self.resources.inc_dirs],
'device': self.iar_device(),
'ewp': sep+self.project_name + ".ewp",
'debugger': debugger
'debugger': debugger,
'defines': defines
}
ctx.update(flags)
@ -200,5 +203,3 @@ class IAR(Exporter):
return -1
else:
return 0

View File

@ -479,7 +479,9 @@
</option>
<option>
<name>ADefines</name>
<state></state>
{% for d in defines %}
<state>{{d}}</state>
{% endfor %}
</option>
<option>
<name>AList</name>

View File

@ -154,8 +154,10 @@ class IAR(mbedToolchain):
@hook_tool
def assemble(self, source, object, includes):
_, macros = self.config.get_config_data()
defines = ['-D%s' % d for d in macros] if macros else [""]
# Build assemble command
cmd = self.asm + self.get_compile_options(self.get_symbols(True), includes, True) + ["-o", object, source]
cmd = self.asm + self.get_compile_options(self.get_symbols(True), includes, True) + defines + ["-o", object, source]
# Call cmdline hook
cmd = self.hook.get_cmdline_assembler(cmd)