|
18 | 18 |
|
19 | 19 | import re
|
20 | 20 | import sys
|
| 21 | +import json |
21 | 22 | from os import stat, walk, getcwd, sep, remove
|
22 | 23 | from copy import copy
|
23 | 24 | from time import time, sleep
|
@@ -1299,11 +1300,17 @@ def dump_build_profile(self):
|
1299 | 1300 | """Dump the current build profile and macros into the `.profile` file
|
1300 | 1301 | in the build directory"""
|
1301 | 1302 | for key in ["cxx", "c", "asm", "ld"]:
|
1302 |
| - to_dump = (str(self.flags[key]) + str(sorted(self.macros))) |
| 1303 | + to_dump = { |
| 1304 | + "flags": sorted(self.flags[key]), |
| 1305 | + "macros": sorted(self.macros), |
| 1306 | + "symbols": sorted(self.get_symbols(for_asm=(key == "asm"))), |
| 1307 | + } |
1303 | 1308 | if key in ["cxx", "c"]:
|
1304 |
| - to_dump += str(self.flags['common']) |
| 1309 | + to_dump["symbols"].remove('MBED_BUILD_TIMESTAMP=%s' % self.timestamp) |
| 1310 | + to_dump["flags"].extend(sorted(self.flags['common'])) |
1305 | 1311 | where = join(self.build_dir, self.PROFILE_FILE_NAME + "-" + key)
|
1306 |
| - self._overwrite_when_not_equal(where, to_dump) |
| 1312 | + self._overwrite_when_not_equal(where, json.dumps( |
| 1313 | + to_dump, sort_keys=True, indent=4)) |
1307 | 1314 |
|
1308 | 1315 | @staticmethod
|
1309 | 1316 | def _overwrite_when_not_equal(filename, content):
|
|
0 commit comments