Skip to content

Commit c40d860

Browse files
author
Cruz Monrreal
authored
Merge pull request #8249 from theotherjimmy/official-tc-support
Tools: Restrict toolchains reported by mbed compile -S to official ones
2 parents c004aa8 + b957f60 commit c40d860

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed

tools/build_api.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,20 +1072,10 @@ def get_unique_supported_toolchains(release_targets=None):
10721072
If release_targets is not specified, then it queries all
10731073
known targets
10741074
"""
1075-
unique_supported_toolchains = []
1076-
1077-
if not release_targets:
1078-
for target in TARGET_NAMES:
1079-
for toolchain in TARGET_MAP[target].supported_toolchains:
1080-
if toolchain not in unique_supported_toolchains:
1081-
unique_supported_toolchains.append(toolchain)
1082-
else:
1083-
for target in release_targets:
1084-
for toolchain in target[1]:
1085-
if toolchain not in unique_supported_toolchains:
1086-
unique_supported_toolchains.append(toolchain)
1087-
1088-
return unique_supported_toolchains
1075+
return [
1076+
name for name, cls in TOOLCHAIN_CLASSES.items()
1077+
if cls.OFFICIALLY_SUPPORTED
1078+
]
10891079

10901080

10911081
def _lowercase_release_version(release_version):

tools/toolchains/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
CPU_COEF = 1
4949

5050
class mbedToolchain:
51+
OFFICIALLY_SUPPORTED = False
52+
5153
# Verbose logging
5254
VERBOSE = True
5355

tools/toolchains/arm.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ def redirect_symbol(source, sync, build_dir):
337337

338338

339339
class ARM_STD(ARM):
340+
OFFICIALLY_SUPPORTED = True
340341
def __init__(self, target, notify=None, macros=None,
341342
build_profile=None, build_dir=None):
342343
ARM.__init__(self, target, notify, macros, build_dir=build_dir,
@@ -347,6 +348,7 @@ def __init__(self, target, notify=None, macros=None,
347348

348349
class ARM_MICRO(ARM):
349350
PATCHED_LIBRARY = False
351+
OFFICIALLY_SUPPORTED = True
350352
def __init__(self, target, notify=None, macros=None,
351353
silent=False, extra_verbose=False, build_profile=None,
352354
build_dir=None):
@@ -357,6 +359,7 @@ def __init__(self, target, notify=None, macros=None,
357359
raise NotSupportedException("ARM/uARM compiler support is required for ARM build")
358360

359361
class ARMC6(ARM_STD):
362+
OFFICIALLY_SUPPORTED = False
360363
SHEBANG = "#! armclang -E --target=arm-arm-none-eabi -x c"
361364
SUPPORTED_CORES = ["Cortex-M0", "Cortex-M0+", "Cortex-M3", "Cortex-M4",
362365
"Cortex-M4F", "Cortex-M7", "Cortex-M7F", "Cortex-M7FD",

tools/toolchains/gcc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from tools.utils import run_cmd, NotSupportedException
2626

2727
class GCC(mbedToolchain):
28+
OFFICIALLY_SUPPORTED = True
2829
LINKER_EXT = '.ld'
2930
LIBRARY_EXT = '.a'
3031

tools/toolchains/iar.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from tools.utils import run_cmd, NotSupportedException
2525

2626
class IAR(mbedToolchain):
27+
OFFICIALLY_SUPPORTED = True
2728
LIBRARY_EXT = '.a'
2829
LINKER_EXT = '.icf'
2930
STD_LIB_NAME = "%s.a"

0 commit comments

Comments
 (0)