Skip to content

Commit a802ab8

Browse files
authored
Merge pull request ARMmbed#13007 from Patater/default-lib-c-compat
tools: Support default_lib and c_lib
2 parents 9a8c9e2 + 5e65cf7 commit a802ab8

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tools/toolchains/mbed_toolchain.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def is_not_supported_error(self, output):
652652

653653
@abstractmethod
654654
def parse_output(self, output):
655-
"""Take in compiler output and extract sinlge line warnings and errors from it.
655+
"""Take in compiler output and extract single line warnings and errors from it.
656656
657657
Positional arguments:
658658
output -- a string of all the messages emitted by a run of the compiler
@@ -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)