@@ -331,7 +331,7 @@ def prepare_toolchain(src_paths, build_dir, target, toolchain_name,
331
331
extra_verbose - even more output!
332
332
config - a Config object to use instead of creating one
333
333
app_config - location of a chosen mbed_app.json file
334
- build_profile - a dict of flags that will be passed to the compiler
334
+ build_profile - a list of mergeable build profiles
335
335
"""
336
336
337
337
# We need to remove all paths which are repeated to avoid
@@ -345,12 +345,17 @@ def prepare_toolchain(src_paths, build_dir, target, toolchain_name,
345
345
cur_tc = TOOLCHAIN_CLASSES [toolchain_name ]
346
346
except KeyError :
347
347
raise KeyError ("Toolchain %s not supported" % toolchain_name )
348
+
349
+ profile = {'c' : [], 'cxx' : [], 'common' : [], 'asm' : [], 'ld' : []}
350
+ for contents in build_profile or []:
351
+ for key in profile :
352
+ profile [key ].extend (contents [toolchain_name ][key ])
353
+
348
354
if config .has_regions :
349
- add_regions_to_profile (build_profile , config , cur_tc )
355
+ add_regions_to_profile (profile , config , cur_tc )
350
356
351
- # Toolchain instance
352
357
toolchain = cur_tc (target , notify , macros , silent , build_dir = build_dir ,
353
- extra_verbose = extra_verbose , build_profile = build_profile )
358
+ extra_verbose = extra_verbose , build_profile = profile )
354
359
355
360
toolchain .config = config
356
361
toolchain .jobs = jobs
0 commit comments