Skip to content

Commit 7ced068

Browse files
committed
Fix for review comments and ARMC5 listing added for supported toolchain matrix output
1 parent f8dc7c2 commit 7ced068

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

tools/build_api.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ def is_official_target(target_name, version):
251251

252252
return result, reason
253253

254-
def transform_release_toolchains(toolchains, version, target):
255-
""" Given a list of toolchains, release version and target(needed for checking build tools version), return a list of
254+
def transform_release_toolchains(target, version):
255+
""" Given a release version and target, return a list of
256256
only the supported toolchains for that release
257257
258258
Positional arguments:
@@ -262,17 +262,17 @@ def transform_release_toolchains(toolchains, version, target):
262262
"""
263263
if int(target.build_tools_metadata["version"]) > 0:
264264
if version == '5':
265-
if 'ARMC5' in toolchains:
265+
if 'ARMC5' in target.supported_toolchains:
266266
return ['ARMC5', 'GCC_ARM', 'IAR']
267267
else:
268-
return ['ARM', 'GCC_ARM', 'IAR']
268+
return ['ARM', 'ARMC6', 'GCC_ARM', 'IAR']
269269
else:
270-
return toolchains
270+
return target.supported_toolchains
271271
else:
272272
if version == '5':
273273
return ['ARM', 'GCC_ARM', 'IAR']
274274
else:
275-
return toolchains
275+
return target.supported_toolchains
276276

277277
def get_mbed_official_release(version):
278278
""" Given a release version string, return a tuple that contains a target
@@ -291,7 +291,7 @@ def get_mbed_official_release(version):
291291
[
292292
TARGET_MAP[target].name,
293293
tuple(transform_release_toolchains(
294-
TARGET_MAP[target].supported_toolchains, version, target))
294+
TARGET_MAP[target], version))
295295
]
296296
) for target in TARGET_NAMES \
297297
if (hasattr(TARGET_MAP[target], 'release_versions')
@@ -1256,6 +1256,11 @@ def mcu_toolchain_matrix(verbose_html=False, platform_filter=None,
12561256

12571257
unique_supported_toolchains = get_unique_supported_toolchains(
12581258
release_targets)
1259+
#Add ARMC5 column as well to the matrix to help with showing which targets are in ARMC5
1260+
#ARMC5 is not a toolchain class but yet we use that as a toolchain id in supported_toolchains in targets.json
1261+
#capture that info in a separate column
1262+
unique_supported_toolchains.append('ARMC5')
1263+
12591264
prepend_columns = ["Target"] + ["mbed OS %s" % x for x in RELEASE_VERSIONS]
12601265

12611266
# All tests status table print
@@ -1298,8 +1303,7 @@ def mcu_toolchain_matrix(verbose_html=False, platform_filter=None,
12981303
(unique_toolchain == "ARMC6" and
12991304
"ARM" in tgt_obj.supported_toolchains) or
13001305
(unique_toolchain == "ARM" and
1301-
"ARMC6" in tgt_obj.supported_toolchains and
1302-
CORE_ARCH[tgt_obj.core] == 8)):
1306+
"ARMC6" in tgt_obj.supported_toolchains)):
13031307
text = "Supported"
13041308
perm_counter += 1
13051309
else:

0 commit comments

Comments
 (0)