@@ -274,7 +274,7 @@ def get_mbed_official_release(version):
274
274
275
275
276
276
def prepare_toolchain (src_paths , target , toolchain_name ,
277
- macros = None , options = None , clean = False , jobs = 1 ,
277
+ macros = None , clean = False , jobs = 1 ,
278
278
notify = None , silent = False , verbose = False ,
279
279
extra_verbose = False , config = None ,
280
280
app_config = None , build_profile = None ):
@@ -287,7 +287,6 @@ def prepare_toolchain(src_paths, target, toolchain_name,
287
287
288
288
Keyword arguments:
289
289
macros - additional macros
290
- options - general compiler options like debug-symbols or small-build
291
290
clean - Rebuild everything if True
292
291
jobs - how many compilers we can run at once
293
292
notify - Notify function for logs
@@ -296,6 +295,7 @@ def prepare_toolchain(src_paths, target, toolchain_name,
296
295
extra_verbose - even more output!
297
296
config - a Config object to use instead of creating one
298
297
app_config - location of a chosen mbed_app.json file
298
+ build_profile - a dict of flags that will be passed to the compiler
299
299
"""
300
300
301
301
# We need to remove all paths which are repeated to avoid
@@ -309,7 +309,7 @@ def prepare_toolchain(src_paths, target, toolchain_name,
309
309
# Toolchain instance
310
310
try :
311
311
toolchain = TOOLCHAIN_CLASSES [toolchain_name ](
312
- target , options , notify , macros , silent ,
312
+ target , notify , macros , silent ,
313
313
extra_verbose = extra_verbose , build_profile = build_profile )
314
314
except KeyError :
315
315
raise KeyError ("Toolchain %s not supported" % toolchain_name )
@@ -361,7 +361,7 @@ def scan_resources(src_paths, toolchain, dependencies_paths=None,
361
361
return resources
362
362
363
363
def build_project (src_paths , build_path , target , toolchain_name ,
364
- libraries_paths = None , options = None , linker_script = None ,
364
+ libraries_paths = None , linker_script = None ,
365
365
clean = False , notify = None , verbose = False , name = None ,
366
366
macros = None , inc_dirs = None , jobs = 1 , silent = False ,
367
367
report = None , properties = None , project_id = None ,
@@ -378,7 +378,6 @@ def build_project(src_paths, build_path, target, toolchain_name,
378
378
379
379
Keyword arguments:
380
380
libraries_paths - The location of libraries to include when linking
381
- options - general compiler options like debug-symbols or small-build
382
381
linker_script - the file that drives the linker to do it's job
383
382
clean - Rebuild everything if True
384
383
notify - Notify function for logs
@@ -395,6 +394,7 @@ def build_project(src_paths, build_path, target, toolchain_name,
395
394
extra_verbose - even more output!
396
395
config - a Config object to use instead of creating one
397
396
app_config - location of a chosen mbed_app.json file
397
+ build_profile - a dict of flags that will be passed to the compiler
398
398
"""
399
399
400
400
# Convert src_path to a list if needed
@@ -411,8 +411,8 @@ def build_project(src_paths, build_path, target, toolchain_name,
411
411
412
412
# Pass all params to the unified prepare_toolchain()
413
413
toolchain = prepare_toolchain (
414
- src_paths , target , toolchain_name , macros = macros , options = options ,
415
- clean = clean , jobs = jobs , notify = notify , silent = silent , verbose = verbose ,
414
+ src_paths , target , toolchain_name , macros = macros , clean = clean ,
415
+ jobs = jobs , notify = notify , silent = silent , verbose = verbose ,
416
416
extra_verbose = extra_verbose , config = config , app_config = app_config ,
417
417
build_profile = build_profile )
418
418
@@ -484,11 +484,12 @@ def build_project(src_paths, build_path, target, toolchain_name,
484
484
raise
485
485
486
486
def build_library (src_paths , build_path , target , toolchain_name ,
487
- dependencies_paths = None , options = None , name = None , clean = False ,
487
+ dependencies_paths = None , name = None , clean = False ,
488
488
archive = True , notify = None , verbose = False , macros = None ,
489
489
inc_dirs = None , jobs = 1 , silent = False , report = None ,
490
490
properties = None , extra_verbose = False , project_id = None ,
491
- remove_config_header_file = False , app_config = None ):
491
+ remove_config_header_file = False , app_config = None ,
492
+ build_profile = None ):
492
493
""" Build a library
493
494
494
495
Positional arguments:
@@ -500,7 +501,6 @@ def build_library(src_paths, build_path, target, toolchain_name,
500
501
501
502
Keyword arguments:
502
503
dependencies_paths - The location of libraries to include when linking
503
- options - general compiler options like debug-symbols or small-build
504
504
name - the name of the library
505
505
clean - Rebuild everything if True
506
506
archive - whether the library will create an archive file
@@ -516,6 +516,7 @@ def build_library(src_paths, build_path, target, toolchain_name,
516
516
project_id - the name that goes in the report
517
517
remove_config_header_file - delete config header file when done building
518
518
app_config - location of a chosen mbed_app.json file
519
+ build_profile - a dict of flags that will be passed to the compiler
519
520
"""
520
521
521
522
# Convert src_path to a list if needed
@@ -537,9 +538,10 @@ def build_library(src_paths, build_path, target, toolchain_name,
537
538
538
539
# Pass all params to the unified prepare_toolchain()
539
540
toolchain = prepare_toolchain (
540
- src_paths , target , toolchain_name , macros = macros , options = options ,
541
- clean = clean , jobs = jobs , notify = notify , silent = silent , verbose = verbose ,
542
- extra_verbose = extra_verbose , app_config = app_config )
541
+ src_paths , target , toolchain_name , macros = macros , clean = clean ,
542
+ jobs = jobs , notify = notify , silent = silent , verbose = verbose ,
543
+ extra_verbose = extra_verbose , app_config = app_config ,
544
+ build_profile = build_profile )
543
545
544
546
# The first path will give the name to the library
545
547
if name is None :
@@ -640,9 +642,10 @@ def build_library(src_paths, build_path, target, toolchain_name,
640
642
### Legacy methods ###
641
643
######################
642
644
643
- def build_lib (lib_id , target , toolchain_name , options = None , verbose = False ,
645
+ def build_lib (lib_id , target , toolchain_name , verbose = False ,
644
646
clean = False , macros = None , notify = None , jobs = 1 , silent = False ,
645
- report = None , properties = None , extra_verbose = False ):
647
+ report = None , properties = None , extra_verbose = False ,
648
+ build_profile = None ):
646
649
""" Legacy method for building mbed libraries
647
650
648
651
Positional arguments:
@@ -651,7 +654,6 @@ def build_lib(lib_id, target, toolchain_name, options=None, verbose=False,
651
654
toolchain_name - the name of the build tools
652
655
653
656
Keyword arguments:
654
- options - general compiler options like debug-symbols or small-build
655
657
clean - Rebuild everything if True
656
658
verbose - Write the actual tools command lines used if True
657
659
macros - additional macros
@@ -661,6 +663,7 @@ def build_lib(lib_id, target, toolchain_name, options=None, verbose=False,
661
663
report - a dict where a result may be appended
662
664
properties - UUUUHHHHH beats me
663
665
extra_verbose - even more output!
666
+ build_profile - a dict of flags that will be passed to the compiler
664
667
"""
665
668
lib = Library (lib_id )
666
669
if not lib .is_supported (target , toolchain_name ):
@@ -716,8 +719,8 @@ def build_lib(lib_id, target, toolchain_name, options=None, verbose=False,
716
719
try :
717
720
# Toolchain instance
718
721
toolchain = TOOLCHAIN_CLASSES [toolchain_name ](
719
- target , options , macros = macros , notify = notify , silent = silent ,
720
- extra_verbose = extra_verbose )
722
+ target , macros = macros , notify = notify , silent = silent ,
723
+ extra_verbose = extra_verbose , build_profile = build_profile )
721
724
toolchain .VERBOSE = verbose
722
725
toolchain .jobs = jobs
723
726
toolchain .build_all = clean
@@ -805,9 +808,10 @@ def build_lib(lib_id, target, toolchain_name, options=None, verbose=False,
805
808
806
809
# We do have unique legacy conventions about how we build and package the mbed
807
810
# library
808
- def build_mbed_libs (target , toolchain_name , options = None , verbose = False ,
811
+ def build_mbed_libs (target , toolchain_name , verbose = False ,
809
812
clean = False , macros = None , notify = None , jobs = 1 , silent = False ,
810
- report = None , properties = None , extra_verbose = False ):
813
+ report = None , properties = None , extra_verbose = False ,
814
+ build_profile = None ):
811
815
""" Function returns True is library was built and false if building was
812
816
skipped
813
817
@@ -816,7 +820,6 @@ def build_mbed_libs(target, toolchain_name, options=None, verbose=False,
816
820
toolchain_name - the name of the build tools
817
821
818
822
Keyword arguments:
819
- options - general compiler options like debug-symbols or small-build
820
823
verbose - Write the actual tools command lines used if True
821
824
clean - Rebuild everything if True
822
825
macros - additional macros
@@ -826,6 +829,7 @@ def build_mbed_libs(target, toolchain_name, options=None, verbose=False,
826
829
report - a dict where a result may be appended
827
830
properties - UUUUHHHHH beats me
828
831
extra_verbose - even more output!
832
+ build_profile - a dict of flags that will be passed to the compiler
829
833
"""
830
834
831
835
if report != None :
@@ -860,8 +864,8 @@ def build_mbed_libs(target, toolchain_name, options=None, verbose=False,
860
864
try :
861
865
# Toolchain
862
866
toolchain = TOOLCHAIN_CLASSES [toolchain_name ](
863
- target , options , macros = macros , notify = notify , silent = silent ,
864
- extra_verbose = extra_verbose )
867
+ target , macros = macros , notify = notify , silent = silent ,
868
+ extra_verbose = extra_verbose , build_profile = build_profile )
865
869
toolchain .VERBOSE = verbose
866
870
toolchain .jobs = jobs
867
871
toolchain .build_all = clean
@@ -1097,9 +1101,9 @@ def get_target_supported_toolchains(target):
1097
1101
1098
1102
1099
1103
def static_analysis_scan (target , toolchain_name , cppcheck_cmd ,
1100
- cppcheck_msg_format , options = None , verbose = False ,
1104
+ cppcheck_msg_format , verbose = False ,
1101
1105
clean = False , macros = None , notify = None , jobs = 1 ,
1102
- extra_verbose = False ):
1106
+ extra_verbose = False , build_profile = None ):
1103
1107
"""Perform static analysis on a target and toolchain combination
1104
1108
1105
1109
Positional arguments:
@@ -1109,18 +1113,19 @@ def static_analysis_scan(target, toolchain_name, cppcheck_cmd,
1109
1113
cppcheck_msg_format - the format of the check messages
1110
1114
1111
1115
Keyword arguments:
1112
- options - things like debug-symbols, or small-build, etc.
1113
1116
verbose - more printing!
1114
1117
clean - start from a clean slate
1115
1118
macros - extra macros to compile with
1116
1119
notify - the notification event handling function
1117
1120
jobs - number of commands to run at once
1118
1121
extra_verbose - even moar printing
1122
+ build_profile - a dict of flags that will be passed to the compiler
1119
1123
"""
1120
1124
# Toolchain
1121
- toolchain = TOOLCHAIN_CLASSES [toolchain_name ](target , options ,
1122
- macros = macros , notify = notify ,
1123
- extra_verbose = extra_verbose )
1125
+ toolchain = TOOLCHAIN_CLASSES [toolchain_name ](target , macros = macros ,
1126
+ notify = notify ,
1127
+ extra_verbose = extra_verbose ,
1128
+ build_profile = build_profile )
1124
1129
toolchain .VERBOSE = verbose
1125
1130
toolchain .jobs = jobs
1126
1131
toolchain .build_all = clean
@@ -1242,30 +1247,30 @@ def static_analysis_scan(target, toolchain_name, cppcheck_cmd,
1242
1247
1243
1248
1244
1249
def static_analysis_scan_lib (lib_id , target , toolchain , cppcheck_cmd ,
1245
- cppcheck_msg_format , options = None , verbose = False ,
1250
+ cppcheck_msg_format , verbose = False ,
1246
1251
clean = False , macros = None , notify = None , jobs = 1 ,
1247
- extra_verbose = False ):
1252
+ extra_verbose = False , build_profile = None ):
1248
1253
"""Perform static analysis on a library as if it were to be compiled for a
1249
1254
particular target and toolchain combination
1250
1255
"""
1251
1256
lib = Library (lib_id )
1252
1257
if lib .is_supported (target , toolchain ):
1253
1258
static_analysis_scan_library (
1254
1259
lib .source_dir , lib .build_dir , target , toolchain , cppcheck_cmd ,
1255
- cppcheck_msg_format , lib .dependencies , options , verbose = verbose ,
1260
+ cppcheck_msg_format , lib .dependencies , verbose = verbose ,
1256
1261
clean = clean , macros = macros , notify = notify , jobs = jobs ,
1257
- extra_verbose = extra_verbose )
1262
+ extra_verbose = extra_verbose , build_profile = build_profile )
1258
1263
else :
1259
1264
print ('Library "%s" is not yet supported on target %s with toolchain %s'
1260
1265
% (lib_id , target .name , toolchain ))
1261
1266
1262
1267
1263
1268
def static_analysis_scan_library (src_paths , build_path , target , toolchain_name ,
1264
1269
cppcheck_cmd , cppcheck_msg_format ,
1265
- dependencies_paths = None , options = None ,
1270
+ dependencies_paths = None ,
1266
1271
name = None , clean = False , notify = None ,
1267
1272
verbose = False , macros = None , jobs = 1 ,
1268
- extra_verbose = False ):
1273
+ extra_verbose = False , build_profile = None ):
1269
1274
""" Function scans library for statically detectable defects
1270
1275
1271
1276
Positional arguments:
@@ -1278,14 +1283,14 @@ def static_analysis_scan_library(src_paths, build_path, target, toolchain_name,
1278
1283
1279
1284
Keyword arguments:
1280
1285
dependencies_paths - the paths to sources that this library depends on
1281
- options - things like debug-symbols, or small-build, etc.
1282
1286
name - the name of this library
1283
1287
clean - start from a clean slate
1284
1288
notify - the notification event handling function
1285
1289
verbose - more printing!
1286
1290
macros - extra macros to compile with
1287
1291
jobs - number of commands to run at once
1288
1292
extra_verbose - even moar printing
1293
+ build_profile - a dict of flags that will be passed to the compiler
1289
1294
"""
1290
1295
if type (src_paths ) != ListType :
1291
1296
src_paths = [src_paths ]
@@ -1296,9 +1301,10 @@ def static_analysis_scan_library(src_paths, build_path, target, toolchain_name,
1296
1301
src_path )
1297
1302
1298
1303
# Toolchain instance
1299
- toolchain = TOOLCHAIN_CLASSES [toolchain_name ](target , options ,
1300
- macros = macros , notify = notify ,
1301
- extra_verbose = extra_verbose )
1304
+ toolchain = TOOLCHAIN_CLASSES [toolchain_name ](target , macros = macros ,
1305
+ notify = notify ,
1306
+ extra_verbose = extra_verbose ,
1307
+ build_profile = build_profile )
1302
1308
toolchain .VERBOSE = verbose
1303
1309
toolchain .jobs = jobs
1304
1310
0 commit comments