Compute ARM_STD and ARM_MICRO labels with target attrs

pull/7197/head
Jimmy Brisson 2018-06-12 09:54:34 -05:00
parent b922201a9c
commit 1d9fd830af
2 changed files with 16 additions and 2 deletions

View File

@ -532,8 +532,7 @@ class mbedToolchain:
def get_labels(self):
if self.labels is None:
toolchain_labels = [c.__name__ for c in getmro(self.__class__)]
toolchain_labels.remove('mbedToolchain')
toolchain_labels = self._get_toolchain_labels()
self.labels = {
'TARGET': self.target.labels,
'FEATURE': self.target.features,
@ -551,6 +550,12 @@ class mbedToolchain:
self.labels['TARGET'].append("RELEASE")
return self.labels
def _get_toolchain_labels(self):
toolchain_labels = [c.__name__ for c in getmro(self.__class__)]
toolchain_labels.remove('mbedToolchain')
toolchain_labels.remove('object')
return toolchain_labels
# Determine whether a source file needs updating/compiling
def need_update(self, target, dependencies):

View File

@ -91,6 +91,12 @@ class ARM(mbedToolchain):
self.SHEBANG += " --cpu=%s" % cpu
def _get_toolchain_labels(self):
if getattr(self.target, "defalut_lib", "std") == "small":
return ["ARM", "ARM_MICRO"]
else:
return ["ARM", "ARM_STD"]
def parse_dependencies(self, dep_path):
dependencies = []
for line in open(dep_path).readlines():
@ -394,6 +400,9 @@ class ARMC6(ARM_STD):
self.ar = [join(TOOLCHAIN_PATHS["ARMC6"], "armar")]
self.elf2bin = join(TOOLCHAIN_PATHS["ARMC6"], "fromelf")
def _get_toolchain_labels(self):
return ["ARM", "ARM_STD", "ARMC6"]
def parse_dependencies(self, dep_path):
return mbedToolchain.parse_dependencies(self, dep_path)