MCPcopy Create free account
hub / github.com/ARMmbed/DAPLink / generate_custom_profile

Function generate_custom_profile

tools/mbedcli_tools/generate_custom_cli_files.py:21–44  ·  view source on GitHub ↗
(build_dicts, compiler='ARM', tool_search='make_armcc', filename = 'custom_profile.json')

Source from the content-addressed store, hash-verified

19import json
20
21def generate_custom_profile(build_dicts, compiler='ARM', tool_search='make_armcc', filename = 'custom_profile.json'):
22 profile_dict = {
23 compiler: {
24 "common": [],
25 "asm": [],
26 "c": [],
27 "cxx": [],
28 "ld": []
29 }
30 }
31 if 'tool_specific' in build_dicts:
32 for entry in build_dicts['tool_specific']:
33 if entry == tool_search:
34 if 'misc' in build_dicts['tool_specific'][entry]:
35 for flags in build_dicts['tool_specific'][entry]['misc']:
36 if flags.endswith('_flags'):
37 cli_entry = flags[:-len('_flags')]
38 if cli_entry in profile_dict[compiler]:
39 profile_dict[compiler][cli_entry].extend(build_dicts['tool_specific'][entry]['misc'][flags])
40 else:
41 profile_dict[compiler][cli_entry] = build_dicts['tool_specific'][entry]['misc'][flags]
42
43 with open(filename, 'w') as custom_profile:
44 json.dump(profile_dict, custom_profile, indent=4, separators=(',', ': '))
45
46def generate_custom_targets(target_name, build_dicts, out_ext='hex', filename = 'custom_targets.json'):
47 target_dict = {

Callers 1

generate_mbedcli_filesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected