Export command line for including mbed_conf.h from toolchains

pull/1975/head
Jimmy Brisson 2016-06-16 13:34:02 -05:00
parent 4f29483255
commit 5532fb8697
3 changed files with 14 additions and 4 deletions

View File

@ -114,11 +114,14 @@ class ARM(mbedToolchain):
dep_path = base + '.d'
return ["--depend", dep_path]
def get_config_option(self, config_header) :
return ['--preinclude', config_header]
def get_compile_options(self, defines, includes):
opts = ['-D%s' % d for d in defines] + ['--via', self.get_inc_file(includes)]
config_header = self.get_config_header()
if config_header is not None:
opts = opts + ['--preinclude', config_header]
opts = opts + self.get_config_option(config_header)
return opts
@hook_tool

View File

@ -165,11 +165,14 @@ class GCC(mbedToolchain):
dep_path = base + '.d'
return ["-MD", "-MF", dep_path]
def get_config_option(self, config_header):
return ['-include', config_header]
def get_compile_options(self, defines, includes):
opts = ['-D%s' % d for d in defines] + ['@%s' % self.get_inc_file(includes)]
config_header = self.get_config_header()
if config_header is not None:
opts = opts + ['-include', config_header]
opts = opts + self.get_conifg_option(config_header)
return opts
@hook_tool

View File

@ -126,8 +126,12 @@ class IAR(mbedToolchain):
base, _ = splitext(object)
return ["-l", base + '.s.txt']
def get_config_option(self, config_header):
return ['--preinclude', config_header]
def get_compile_options(self, defines, includes, for_asm=False):
opts = ['-D%s' % d for d in defines] + ['-f', self.get_inc_file(includes)]
opts = ['-f', self.get_inc_file(includes)]
config_header = self.get_config_header()
if for_asm:
# The assembler doesn't support '--preinclude', so we need to add
# the macros directly
@ -135,7 +139,7 @@ class IAR(mbedToolchain):
else:
config_header = self.get_config_header()
if config_header is not None:
opts = opts + ['--preinclude', config_header]
opts = opts + self.get_config_option(config_header)
return opts
@hook_tool