@@ -301,7 +301,7 @@ def target_supports_toolchain(target, toolchain_name):
301
301
def prepare_toolchain (src_paths , build_dir , target , toolchain_name ,
302
302
macros = None , clean = False , jobs = 1 ,
303
303
notify = None , config = None , app_config = None ,
304
- build_profile = None ):
304
+ build_profile = None , ignore = None ):
305
305
""" Prepares resource related objects - toolchain, target, config
306
306
307
307
Positional arguments:
@@ -317,6 +317,7 @@ def prepare_toolchain(src_paths, build_dir, target, toolchain_name,
317
317
config - a Config object to use instead of creating one
318
318
app_config - location of a chosen mbed_app.json file
319
319
build_profile - a list of mergeable build profiles
320
+ ignore - list of paths to add to mbedignore
320
321
"""
321
322
322
323
# We need to remove all paths which are repeated to avoid
@@ -348,6 +349,9 @@ def prepare_toolchain(src_paths, build_dir, target, toolchain_name,
348
349
toolchain .jobs = jobs
349
350
toolchain .build_all = clean
350
351
352
+ if ignore :
353
+ toolchain .add_ignore_patterns (root = "." , base_path = "." , patterns = ignore )
354
+
351
355
return toolchain
352
356
353
357
def _printihex (ihex ):
@@ -547,11 +551,7 @@ def build_project(src_paths, build_path, target, toolchain_name,
547
551
toolchain = prepare_toolchain (
548
552
src_paths , build_path , target , toolchain_name , macros = macros ,
549
553
clean = clean , jobs = jobs , notify = notify , config = config ,
550
- app_config = app_config , build_profile = build_profile )
551
-
552
- if ignore :
553
- toolchain .add_ignore_patterns (root = "." , base_path = "." ,
554
- patterns = ignore )
554
+ app_config = app_config , build_profile = build_profile , ignore = ignore )
555
555
556
556
# The first path will give the name to the library
557
557
name = (name or toolchain .config .name or
@@ -697,11 +697,7 @@ def build_library(src_paths, build_path, target, toolchain_name,
697
697
toolchain = prepare_toolchain (
698
698
src_paths , build_path , target , toolchain_name , macros = macros ,
699
699
clean = clean , jobs = jobs , notify = notify , app_config = app_config ,
700
- build_profile = build_profile )
701
-
702
- if ignore :
703
- toolchain .add_ignore_patterns (root = "." , base_path = "." ,
704
- patterns = ignore )
700
+ build_profile = build_profile , ignore = ignore )
705
701
706
702
# The first path will give the name to the library
707
703
if name is None :
@@ -803,7 +799,7 @@ def mbed2_obj_path(target_name, toolchain_name):
803
799
804
800
def build_lib (lib_id , target , toolchain_name , clean = False , macros = None ,
805
801
notify = None , jobs = 1 , report = None , properties = None ,
806
- build_profile = None ):
802
+ build_profile = None , ignore = None ):
807
803
""" Legacy method for building mbed libraries
808
804
809
805
Positional arguments:
@@ -819,6 +815,7 @@ def build_lib(lib_id, target, toolchain_name, clean=False, macros=None,
819
815
report - a dict where a result may be appended
820
816
properties - UUUUHHHHH beats me
821
817
build_profile - a dict of flags that will be passed to the compiler
818
+ ignore - list of paths to add to mbedignore
822
819
"""
823
820
lib = Library (lib_id )
824
821
if not lib .is_supported (target , toolchain_name ):
@@ -882,7 +879,8 @@ def build_lib(lib_id, target, toolchain_name, clean=False, macros=None,
882
879
883
880
toolchain = prepare_toolchain (
884
881
src_paths , tmp_path , target , toolchain_name , macros = macros ,
885
- notify = notify , build_profile = build_profile , jobs = jobs , clean = clean )
882
+ notify = notify , build_profile = build_profile , jobs = jobs , clean = clean ,
883
+ ignore = ignore )
886
884
887
885
notify .info ("Building library %s (%s, %s)" %
888
886
(name .upper (), target .name , toolchain_name ))
@@ -958,7 +956,7 @@ def build_lib(lib_id, target, toolchain_name, clean=False, macros=None,
958
956
# library
959
957
def build_mbed_libs (target , toolchain_name , clean = False , macros = None ,
960
958
notify = None , jobs = 1 , report = None , properties = None ,
961
- build_profile = None ):
959
+ build_profile = None , ignore = None ):
962
960
""" Function returns True is library was built and false if building was
963
961
skipped
964
962
@@ -974,6 +972,7 @@ def build_mbed_libs(target, toolchain_name, clean=False, macros=None,
974
972
report - a dict where a result may be appended
975
973
properties - UUUUHHHHH beats me
976
974
build_profile - a dict of flags that will be passed to the compiler
975
+ ignore - list of paths to add to mbedignore
977
976
"""
978
977
979
978
if report != None :
@@ -1017,7 +1016,7 @@ def build_mbed_libs(target, toolchain_name, clean=False, macros=None,
1017
1016
1018
1017
toolchain = prepare_toolchain (
1019
1018
["" ], tmp_path , target , toolchain_name , macros = macros , notify = notify ,
1020
- build_profile = build_profile , jobs = jobs , clean = clean )
1019
+ build_profile = build_profile , jobs = jobs , clean = clean , ignore = ignore )
1021
1020
1022
1021
# Take into account the library configuration (MBED_CONFIG_FILE)
1023
1022
config = toolchain .config
0 commit comments