@@ -160,7 +160,7 @@ def build_mbed_libs(target, toolchain_name, options=None, verbose=False, clean=F
160
160
cmsis_src = join (MBED_TARGETS_PATH , "cmsis" )
161
161
resources = toolchain .scan_resources (cmsis_src )
162
162
163
- toolchain .copy_files (resources .headers , BUILD_TARGET )
163
+ toolchain .copy_files (resources .headers , BUILD_TARGET , cmsis_src )
164
164
toolchain .copy_files (resources .linker_script , BUILD_TOOLCHAIN )
165
165
166
166
objects = toolchain .compile_sources (resources , TMP_PATH )
@@ -176,12 +176,13 @@ def build_mbed_libs(target, toolchain_name, options=None, verbose=False, clean=F
176
176
# Target specific sources
177
177
HAL_SRC = join (MBED_TARGETS_PATH , "hal" )
178
178
hal_implementation = toolchain .scan_resources (HAL_SRC )
179
- toolchain .copy_files (hal_implementation .headers , BUILD_TARGET )
180
- objects = toolchain .compile_sources (hal_implementation , TMP_PATH , [MBED_LIBRARIES , BUILD_TARGET ])
179
+ toolchain .copy_files (hal_implementation .headers , BUILD_TARGET , HAL_SRC )
180
+ incdirs = toolchain .scan_resources (BUILD_TARGET ).inc_dirs
181
+ objects = toolchain .compile_sources (hal_implementation , TMP_PATH , [MBED_LIBRARIES ] + incdirs )
181
182
182
183
# Common Sources
183
184
mbed_resources = toolchain .scan_resources (MBED_COMMON )
184
- objects += toolchain .compile_sources (mbed_resources , TMP_PATH , [MBED_LIBRARIES , BUILD_TARGET ] )
185
+ objects += toolchain .compile_sources (mbed_resources , TMP_PATH , [MBED_LIBRARIES ] + incdirs )
185
186
186
187
# Keep retargeting as a standalone object to be sure the
187
188
# C standard library symbols get overridden
0 commit comments