(build_dicts, compiler='ARM', tool_search='make_armcc', filename = 'custom_profile.json')
| 19 | import json |
| 20 | |
| 21 | def 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 | |
| 46 | def generate_custom_targets(target_name, build_dicts, out_ext='hex', filename = 'custom_targets.json'): |
| 47 | target_dict = { |
no outgoing calls
no test coverage detected