Expose present get_compile_options API in Toolcahins

pull/4949/head
Jimmy Brisson 2017-08-21 13:41:46 -05:00
parent 15a9a0382b
commit e9d3166a5e
2 changed files with 23 additions and 1 deletions

View File

@ -105,7 +105,10 @@ class Exporter(object):
config_header = self.toolchain.get_config_header()
flags = {key + "_flags": copy.deepcopy(value) for key, value
in self.toolchain.flags.iteritems()}
asm_defines = ["-D" + symbol for symbol in self.toolchain.get_symbols(True)]
asm_defines = self.toolchain.get_compile_options(
self.toolchain.get_symbols(for_asm=True),
filter(None, self.resources.inc_dirs),
for_asm=True)
c_defines = ["-D" + symbol for symbol in self.toolchain.get_symbols()]
flags['asm_flags'] += asm_defines
flags['c_flags'] += c_defines

View File

@ -1356,6 +1356,25 @@ class mbedToolchain:
"""
raise NotImplemented
@abstractmethod
def get_compile_options(self, defines, includes, for_asm=False):
"""Generate the compiler options from the defines and includes
Positional arguments:
defines -- The preprocessor macros defined on the command line
includes -- The include file search paths
Keyword arguments:
for_asm -- generate the assembler options instead of the compiler options
Return value:
A list of the command line arguments that will force the inclusion the specified header
Side effects:
None
"""
raise NotImplemented
@abstractmethod
def assemble(self, source, object, includes):
"""Generate the command line that assembles.