Skip to content

Commit f87fab5

Browse files
committed
Use via file for ASM macros in IAR
1 parent a775e69 commit f87fab5

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

tools/toolchains/iar.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,26 @@ def get_config_option(self, config_header):
140140

141141
def get_compile_options(self, defines, includes, for_asm=False):
142142
opts = ['-D%s' % d for d in defines]
143-
config_header = self.get_config_header()
144-
if config_header is not None:
145-
opts = opts + self.get_config_option(config_header)
146-
if for_asm :
143+
if for_asm:
144+
config_macros = self.config.get_config_data_macros()
145+
macros_cmd = ['"-D%s"' % d.replace('"', '') for d in config_macros]
146+
if self.RESPONSE_FILES:
147+
via_file = self.make_option_file(
148+
macros_cmd, "asm_macros_{}.xcl")
149+
opts += ['-f', via_file]
150+
else:
151+
opts += macros_cmd
147152
return opts
148-
if self.RESPONSE_FILES:
149-
opts += ['-f', self.get_inc_file(includes)]
150153
else:
151-
opts += ["-I%s" % i for i in includes]
154+
if self.RESPONSE_FILES:
155+
opts += ['-f', self.get_inc_file(includes)]
156+
else:
157+
opts += ["-I%s" % i for i in includes]
158+
config_header = self.get_config_header()
159+
if config_header is not None:
160+
opts = opts + self.get_config_option(config_header)
152161

153-
return opts
162+
return opts
154163

155164
@hook_tool
156165
def assemble(self, source, object, includes):

0 commit comments

Comments
 (0)