Skip to content

Commit 5e65cf7

Browse files
committed
tools: Support default_lib and c_lib
For backwards compatibility reasons, since the latest Mbed OS tools must be able to build any previous online-compiler-supported version of Mbed OS, allow targets to use `default_lib` or `c_lib`. This should enable the tools to work with Mbed OS 5 style targets.json.
1 parent 8be07a4 commit 5e65cf7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tools/toolchains/mbed_toolchain.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,11 +1097,12 @@ def check_c_lib_supported(self, target, toolchain):
10971097
target.c_lib is modified to have the lowercased string of its original string.
10981098
This is done to be case insensitive when validating.
10991099
"""
1100-
if hasattr(target, "default_lib"):
1101-
raise NotSupportedException(
1102-
"target.default_lib is no longer supported, please use target.c_lib for C library selection."
1103-
)
1104-
if hasattr(target, "c_lib"):
1100+
if hasattr(target, "default_lib"):
1101+
# Use default_lib as the c_lib attribute. This allows backwards
1102+
# compatibility with older target definitions, allowing either
1103+
# default_lib or c_lib to specify the C library to use.
1104+
target.c_lib = target.default_lib.lower()
1105+
if hasattr(target, "c_lib"):
11051106
target.c_lib = target.c_lib.lower()
11061107
if (
11071108
hasattr(target, "supported_c_libs") == False

0 commit comments

Comments
 (0)