Skip to content

Commit f6388de

Browse files
theotherjimmyadbridge
authored andcommitted
Fix toolchain path names in Mbed 2 builds
I accidentally broke only uARM mbed 2 builds. Here is the story: When scanning for resources, toolchains look for any `TOOLCHAIN_<classname>` folders to include. These `<classname>`s mostly match the name passed in on the command line with one exception: `uARM` on the command line maps to `ARM_MICRO` the class. This would not be a problem except for the bug that I introduced in a prior commit. The bug is that the mbed2 library builds will use the name passed in on the command line to construct `TOOLCHAIN_<cli-name>`. This will not match when scanning. I fixed it by translating the `<cli-name>` into the `<classname>`.
1 parent 745b8ef commit f6388de

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/build_api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,8 @@ def build_library(src_paths, build_path, target, toolchain_name,
732732
######################
733733

734734
def mbed2_obj_path(target_name, toolchain_name):
735-
return join("TARGET_" + target_name, "TOOLCHAIN_" + toolchain_name)
735+
real_tc_name = TOOLCHAIN_CLASSES[toolchain_name].__name__
736+
return join("TARGET_" + target_name, "TOOLCHAIN_" + real_tc_name)
736737

737738
def build_lib(lib_id, target, toolchain_name, verbose=False,
738739
clean=False, macros=None, notify=None, jobs=1, silent=False,
@@ -955,7 +956,7 @@ def build_mbed_libs(target, toolchain_name, verbose=False,
955956
try:
956957
# Source and Build Paths
957958
build_target = join(MBED_LIBRARIES, "TARGET_" + target.name)
958-
build_toolchain = join(build_target, "TOOLCHAIN_" + toolchain_name)
959+
build_toolchain = join(MBED_LIBRARIES, mbed2_obj_path(target.name, toolchain_name))
959960
mkdir(build_toolchain)
960961

961962
# Toolchain

0 commit comments

Comments
 (0)