Skip to content

Commit b94c418

Browse files
committed
Updating supported toolchain printing with new options
1 parent 1c31d36 commit b94c418

File tree

3 files changed

+9
-33
lines changed

3 files changed

+9
-33
lines changed

tools/build_api.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,30 +1142,6 @@ def _lowercase_release_version(release_version):
11421142
except AttributeError:
11431143
return 'all'
11441144

1145-
def mcu_toolchain_list(release_version='5'):
1146-
""" Shows list of toolchains
1147-
1148-
"""
1149-
release_version = _lowercase_release_version(release_version)
1150-
version_release_targets = {}
1151-
version_release_target_names = {}
1152-
1153-
for version in RELEASE_VERSIONS:
1154-
version_release_targets[version] = get_mbed_official_release(version)
1155-
version_release_target_names[version] = [x[0] for x in
1156-
version_release_targets[
1157-
version]]
1158-
1159-
if release_version in RELEASE_VERSIONS:
1160-
release_targets = version_release_targets[release_version]
1161-
else:
1162-
release_targets = None
1163-
1164-
unique_supported_toolchains = get_unique_supported_toolchains(
1165-
release_targets)
1166-
columns = ["mbed OS %s" % x for x in RELEASE_VERSIONS] + unique_supported_toolchains
1167-
return "\n".join(columns)
1168-
11691145

11701146
def mcu_target_list(release_version='5'):
11711147
""" Shows target list

tools/make.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
from tools.options import get_default_options_parser
4242
from tools.options import extract_profile
4343
from tools.options import extract_mcus
44+
from tools.options import get_toolchain_list
4445
from tools.notifier.term import TerminalNotifier
4546
from tools.build_api import build_project
4647
from tools.build_api import mcu_toolchain_matrix
47-
from tools.build_api import mcu_toolchain_list
4848
from tools.build_api import mcu_target_list
4949
from tools.build_api import merge_build_data
5050
from tools.build_api import find_valid_toolchain
@@ -297,11 +297,7 @@ def main():
297297
release_version=None
298298
))
299299
elif options.supported_toolchains == "toolchains":
300-
toolchain_list = mcu_toolchain_list()
301-
# Only print the lines that matter
302-
for line in toolchain_list.split("\n"):
303-
if "mbed" not in line:
304-
print(line)
300+
print('\n'.join(get_toolchain_list()))
305301
elif options.supported_toolchains == "targets":
306302
print(mcu_target_list())
307303
elif options.list_tests is True:

tools/options.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
"Documentation may be found in "\
3333
"docs/Toolchain_Profiles.md"
3434

35+
def get_toolchain_list():
36+
toolchainlist = list(TOOLCHAINS)
37+
toolchainlist.extend(EXTRA_TOOLCHAIN_NAMES)
38+
toolchainlist.sort()
39+
return toolchainlist
40+
3541
def get_default_options_parser(add_clean=True, add_options=True,
3642
add_app_config=False):
3743
"""Create a new options parser with the default compiler options added
@@ -44,9 +50,7 @@ def get_default_options_parser(add_clean=True, add_options=True,
4450

4551
targetnames = TARGET_NAMES
4652
targetnames.sort()
47-
toolchainlist = list(TOOLCHAINS)
48-
toolchainlist.extend(EXTRA_TOOLCHAIN_NAMES)
49-
toolchainlist.sort()
53+
toolchainlist = get_toolchain_list()
5054

5155
parser.add_argument("-m", "--mcu",
5256
help=("build for the given MCU (%s)" %

0 commit comments

Comments
 (0)