Skip to content

Commit 7a03069

Browse files
author
Bogdan Marinescu
committed
Attempt to keep target's include directory structure
1 parent a2445b3 commit 7a03069

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

workspace_tools/build_api.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def build_mbed_libs(target, toolchain_name, options=None, verbose=False, clean=F
160160
cmsis_src = join(MBED_TARGETS_PATH, "cmsis")
161161
resources = toolchain.scan_resources(cmsis_src)
162162

163-
toolchain.copy_files(resources.headers, BUILD_TARGET)
163+
toolchain.copy_files(resources.headers, BUILD_TARGET, cmsis_src)
164164
toolchain.copy_files(resources.linker_script, BUILD_TOOLCHAIN)
165165

166166
objects = toolchain.compile_sources(resources, TMP_PATH)
@@ -176,12 +176,13 @@ def build_mbed_libs(target, toolchain_name, options=None, verbose=False, clean=F
176176
# Target specific sources
177177
HAL_SRC = join(MBED_TARGETS_PATH, "hal")
178178
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)
181182

182183
# Common Sources
183184
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)
185186

186187
# Keep retargeting as a standalone object to be sure the
187188
# C standard library symbols get overridden

0 commit comments

Comments
 (0)