Skip to content

Commit 73fdc50

Browse files
committed
Incorporated review comments
1 parent d461197 commit 73fdc50

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

tools/test/toolchains/test_toolchains.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def test_iar_minimal_printf(self):
179179
self.assertIn("-DMBED_MINIMAL_PRINTF", iar_obj.flags["common"])
180180

181181
def test_iar_default_lib(self):
182-
"""Test that linker flags are correctly added to an instance of IAR."""
182+
"""Test that case insensitive of the default_lib option works without exception."""
183183
mock_target = mock.MagicMock()
184184
mock_target.core = "Cortex-M4"
185185
mock_target.supported_c_libs = {"iar": ["std"]}

tools/toolchains/arm.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
UARM_TOOLCHAIN_WARNING = (
4141
"Warning: We noticed that you are using uARM Toolchain. "
42-
"We are deprecating the uARM Toolchain. "
42+
"We are deprecating the use of uARM Toolchain. "
4343
"For more information on how to use the ARM toolchain with small C libraries, "
4444
"please visit https://os.mbed.com/docs/mbed-os/latest/reference/using-small-c-libraries.html"
4545
)
@@ -79,7 +79,10 @@ def __init__(self, target, notify=None, macros=None,
7979

8080
self.check_c_lib_supported(target, "arm")
8181

82-
if getattr(target, "default_toolchain", "ARM") == "uARM" or getattr(target, "default_lib", "std") == "small":
82+
if (
83+
getattr(target, "default_toolchain", "ARM") == "uARM"
84+
or getattr(target, "default_lib", "std") == "small"
85+
):
8386
if "-DMBED_RTOS_SINGLE_THREAD" not in self.flags['common']:
8487
self.flags['common'].append("-DMBED_RTOS_SINGLE_THREAD")
8588
if "-D__MICROLIB" not in self.flags['common']:
@@ -566,7 +569,10 @@ def __init__(self, target, *args, **kwargs):
566569

567570
self.check_c_lib_supported(target, "arm")
568571

569-
if getattr(target, "default_toolchain", "ARMC6") == "uARM" or getattr(target, "default_lib", "std") == "small":
572+
if (
573+
getattr(target, "default_toolchain", "ARMC6") == "uARM"
574+
or getattr(target, "default_lib", "std") == "small"
575+
):
570576
if "-DMBED_RTOS_SINGLE_THREAD" not in self.flags['common']:
571577
self.flags['common'].append("-DMBED_RTOS_SINGLE_THREAD")
572578
if "-D__MICROLIB" not in self.flags['common']:

tools/toolchains/gcc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ def __init__(self, target, notify=None, macros=None, build_profile=None,
5454
default_lib = target.default_lib
5555
elif hasattr(target, "default_build"):
5656
default_lib = target.default_build
57-
else:
58-
raise NotSupportedException("default_lib is an empty")
57+
58+
if not default_lib:
59+
raise NotSupportedException("default_lib is not set")
5960

6061
if default_lib == "small":
6162
common_flags = ["-DMBED_RTOS_SINGLE_THREAD", "-D__NEWLIB_NANO"]

0 commit comments

Comments
 (0)