Skip to content

Commit 2cdb00c

Browse files
theotherjimmyCruz Monrreal II
authored andcommitted
Use via file for ASM macros in IAR
1 parent a43df66 commit 2cdb00c

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
@@ -165,17 +165,26 @@ def get_config_option(self, config_header):
165165

166166
def get_compile_options(self, defines, includes, for_asm=False):
167167
opts = ['-D%s' % d for d in defines]
168-
config_header = self.get_config_header()
169-
if config_header is not None:
170-
opts = opts + self.get_config_option(config_header)
171-
if for_asm :
168+
if for_asm:
169+
config_macros = self.config.get_config_data_macros()
170+
macros_cmd = ['"-D%s"' % d.replace('"', '') for d in config_macros]
171+
if self.RESPONSE_FILES:
172+
via_file = self.make_option_file(
173+
macros_cmd, "asm_macros_{}.xcl")
174+
opts += ['-f', via_file]
175+
else:
176+
opts += macros_cmd
172177
return opts
173-
if self.RESPONSE_FILES:
174-
opts += ['-f', self.get_inc_file(includes)]
175178
else:
176-
opts += ["-I%s" % i for i in includes]
179+
if self.RESPONSE_FILES:
180+
opts += ['-f', self.get_inc_file(includes)]
181+
else:
182+
opts += ["-I%s" % i for i in includes]
183+
config_header = self.get_config_header()
184+
if config_header is not None:
185+
opts = opts + self.get_config_option(config_header)
177186

178-
return opts
187+
return opts
179188

180189
@hook_tool
181190
def assemble(self, source, object, includes):

0 commit comments

Comments
 (0)