Skip to content

Commit 1d9fd83

Browse files
committed
Compute ARM_STD and ARM_MICRO labels with target attrs
1 parent b922201 commit 1d9fd83

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

tools/toolchains/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,7 @@ def add_macros(self, new_macros):
532532

533533
def get_labels(self):
534534
if self.labels is None:
535-
toolchain_labels = [c.__name__ for c in getmro(self.__class__)]
536-
toolchain_labels.remove('mbedToolchain')
535+
toolchain_labels = self._get_toolchain_labels()
537536
self.labels = {
538537
'TARGET': self.target.labels,
539538
'FEATURE': self.target.features,
@@ -551,6 +550,12 @@ def get_labels(self):
551550
self.labels['TARGET'].append("RELEASE")
552551
return self.labels
553552

553+
def _get_toolchain_labels(self):
554+
toolchain_labels = [c.__name__ for c in getmro(self.__class__)]
555+
toolchain_labels.remove('mbedToolchain')
556+
toolchain_labels.remove('object')
557+
return toolchain_labels
558+
554559

555560
# Determine whether a source file needs updating/compiling
556561
def need_update(self, target, dependencies):

tools/toolchains/arm.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ def __init__(self, target, notify=None, macros=None,
9191

9292
self.SHEBANG += " --cpu=%s" % cpu
9393

94+
def _get_toolchain_labels(self):
95+
if getattr(self.target, "defalut_lib", "std") == "small":
96+
return ["ARM", "ARM_MICRO"]
97+
else:
98+
return ["ARM", "ARM_STD"]
99+
94100
def parse_dependencies(self, dep_path):
95101
dependencies = []
96102
for line in open(dep_path).readlines():
@@ -394,6 +400,9 @@ def __init__(self, target, *args, **kwargs):
394400
self.ar = [join(TOOLCHAIN_PATHS["ARMC6"], "armar")]
395401
self.elf2bin = join(TOOLCHAIN_PATHS["ARMC6"], "fromelf")
396402

403+
def _get_toolchain_labels(self):
404+
return ["ARM", "ARM_STD", "ARMC6"]
405+
397406
def parse_dependencies(self, dep_path):
398407
return mbedToolchain.parse_dependencies(self, dep_path)
399408

0 commit comments

Comments
 (0)