Skip to content

Commit c21a810

Browse files
author
Cruz Monrreal
authored
Merge pull request #7368 from theotherjimmy/incr-comp-symbols
Tools: Include Symbols in dependency list
2 parents f10bb88 + 95c33f7 commit c21a810

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tools/toolchains/__init__.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import re
2020
import sys
21+
import json
2122
from os import stat, walk, getcwd, sep, remove
2223
from copy import copy
2324
from time import time, sleep
@@ -1299,11 +1300,17 @@ def dump_build_profile(self):
12991300
"""Dump the current build profile and macros into the `.profile` file
13001301
in the build directory"""
13011302
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+
}
13031308
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']))
13051311
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))
13071314

13081315
@staticmethod
13091316
def _overwrite_when_not_equal(filename, content):

0 commit comments

Comments
 (0)