Skip to content

Commit e07b3c7

Browse files
committed
tools: cmsis and hal are build together
Build api used to build cmsis separately (how mbed 2 is being build). This is currently not how cmsis is being defined. As there target dependencies in some cases, we should include paths from targets when building cmsis
1 parent 038324a commit e07b3c7

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

tools/build_api.py

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -999,19 +999,6 @@ def build_mbed_libs(target, toolchain_name, verbose=False,
999999
config.add_config_files([MBED_CONFIG_FILE])
10001000
toolchain.set_config_data(toolchain.config.get_config_data())
10011001

1002-
# CMSIS
1003-
toolchain.info("Building library %s (%s, %s)" %
1004-
('CMSIS', target.name, toolchain_name))
1005-
cmsis_src = MBED_CMSIS_PATH
1006-
resources = toolchain.scan_resources(cmsis_src)
1007-
1008-
toolchain.copy_files(resources.headers, build_target)
1009-
toolchain.copy_files(resources.linker_script, build_toolchain)
1010-
toolchain.copy_files(resources.bin_files, build_toolchain)
1011-
1012-
objects = toolchain.compile_sources(resources, tmp_path)
1013-
toolchain.copy_files(objects, build_toolchain)
1014-
10151002
# mbed
10161003
toolchain.info("Building library %s (%s, %s)" %
10171004
('MBED', target.name, toolchain_name))
@@ -1027,9 +1014,12 @@ def build_mbed_libs(target, toolchain_name, verbose=False,
10271014
toolchain.copy_files(resources.headers, dest)
10281015
library_incdirs.append(dest)
10291016

1030-
# Target specific sources
1031-
hal_src = MBED_TARGETS_PATH
1032-
hal_implementation = toolchain.scan_resources(hal_src)
1017+
cmsis_implementation = toolchain.scan_resources(MBED_CMSIS_PATH)
1018+
toolchain.copy_files(cmsis_implementation.headers, build_target)
1019+
toolchain.copy_files(cmsis_implementation.linker_script, build_toolchain)
1020+
toolchain.copy_files(cmsis_implementation.bin_files, build_toolchain)
1021+
1022+
hal_implementation = toolchain.scan_resources(MBED_TARGETS_PATH)
10331023
toolchain.copy_files(hal_implementation.headers +
10341024
hal_implementation.hex_files +
10351025
hal_implementation.libraries +
@@ -1038,8 +1028,8 @@ def build_mbed_libs(target, toolchain_name, verbose=False,
10381028
toolchain.copy_files(hal_implementation.linker_script, build_toolchain)
10391029
toolchain.copy_files(hal_implementation.bin_files, build_toolchain)
10401030
incdirs = toolchain.scan_resources(build_target).inc_dirs
1041-
objects = toolchain.compile_sources(hal_implementation,
1042-
library_incdirs + incdirs)
1031+
objects = toolchain.compile_sources(cmsis_implementation + hal_implementation,
1032+
library_incdirs + incdirs + [tmp_path])
10431033
toolchain.copy_files(objects, build_toolchain)
10441034

10451035
# Common Sources

0 commit comments

Comments
 (0)