@@ -336,16 +336,6 @@ def build_library(src_paths, build_path, target, toolchain_name,
336
336
for path in src_paths :
337
337
# Scan resources
338
338
resource = toolchain .scan_resources (path )
339
-
340
- # Copy headers, objects and static libraries - all files needed for static lib
341
- toolchain .copy_files (resource .headers , build_path , rel_path = resource .base_path )
342
- toolchain .copy_files (resource .objects , build_path , rel_path = resource .base_path )
343
- toolchain .copy_files (resource .libraries , build_path , rel_path = resource .base_path )
344
- if resource .linker_script :
345
- toolchain .copy_files (resource .linker_script , build_path , rel_path = resource .base_path )
346
-
347
- if resource .hex_files :
348
- toolchain .copy_files (resource .hex_files , build_path , rel_path = resource .base_path )
349
339
350
340
# Extend resources collection
351
341
if not resources :
@@ -404,6 +394,16 @@ def build_library(src_paths, build_path, target, toolchain_name,
404
394
# And add the configuration macros to the toolchain
405
395
toolchain .add_macros (config .get_config_data_macros ())
406
396
397
+ # Copy headers, objects and static libraries - all files needed for static lib
398
+ toolchain .copy_files (resources .headers , build_path , resources = resources )
399
+ toolchain .copy_files (resources .objects , build_path , resources = resources )
400
+ toolchain .copy_files (resources .libraries , build_path , resources = resources )
401
+ if resources .linker_script :
402
+ toolchain .copy_files (resources .linker_script , build_path , resources = resources )
403
+
404
+ if resource .hex_files :
405
+ toolchain .copy_files (resources .hex_files , build_path , resources = resources )
406
+
407
407
# Compile Sources
408
408
objects = toolchain .compile_sources (resources , abspath (tmp_path ), resources .inc_dirs )
409
409
resources .objects .extend (objects )
@@ -544,7 +544,7 @@ def build_lib(lib_id, target, toolchain_name, options=None, verbose=False, clean
544
544
545
545
# Copy Headers
546
546
for resource in resources :
547
- toolchain .copy_files (resource .headers , build_path , rel_path = resource . base_path )
547
+ toolchain .copy_files (resource .headers , build_path , resources = resource )
548
548
549
549
dependencies_include_dir .extend (toolchain .scan_resources (build_path ).inc_dirs )
550
550
@@ -643,7 +643,7 @@ def build_mbed_libs(target, toolchain_name, options=None, verbose=False, clean=F
643
643
# Target specific sources
644
644
HAL_SRC = join (MBED_TARGETS_PATH , "hal" )
645
645
hal_implementation = toolchain .scan_resources (HAL_SRC )
646
- toolchain .copy_files (hal_implementation .headers + hal_implementation .hex_files + hal_implementation .libraries , BUILD_TARGET , HAL_SRC )
646
+ toolchain .copy_files (hal_implementation .headers + hal_implementation .hex_files + hal_implementation .libraries , BUILD_TARGET , resources = hal_implementation )
647
647
incdirs = toolchain .scan_resources (BUILD_TARGET ).inc_dirs
648
648
objects = toolchain .compile_sources (hal_implementation , TMP_PATH , [MBED_LIBRARIES ] + incdirs )
649
649
@@ -821,7 +821,7 @@ def static_analysis_scan(target, toolchain_name, CPPCHECK_CMD, CPPCHECK_MSG_FORM
821
821
hal_implementation = toolchain .scan_resources (HAL_SRC )
822
822
823
823
# Copy files before analysis
824
- toolchain .copy_files (hal_implementation .headers + hal_implementation .hex_files , BUILD_TARGET , HAL_SRC )
824
+ toolchain .copy_files (hal_implementation .headers + hal_implementation .hex_files , BUILD_TARGET , resources = hal_implementation )
825
825
incdirs = toolchain .scan_resources (BUILD_TARGET )
826
826
827
827
target_includes = ["-I%s" % i for i in incdirs .inc_dirs ]
@@ -925,7 +925,7 @@ def static_analysis_scan_library(src_paths, build_path, target, toolchain_name,
925
925
926
926
# Copy Headers
927
927
for resource in resources :
928
- toolchain .copy_files (resource .headers , build_path , rel_path = resource . base_path )
928
+ toolchain .copy_files (resource .headers , build_path , resources = resource )
929
929
includes += ["-I%s" % i for i in resource .inc_dirs ]
930
930
c_sources += " " .join (resource .c_sources ) + " "
931
931
cpp_sources += " " .join (resource .cpp_sources ) + " "
0 commit comments