Merge pull request #7368 from theotherjimmy/incr-comp-symbols

Tools: Include Symbols in dependency list
pull/7332/merge
Cruz Monrreal 2018-06-29 19:58:31 -05:00 committed by GitHub
commit c21a81062c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 3 deletions

View File

@ -18,6 +18,7 @@ from __future__ import print_function, division, absolute_import
import re
import sys
import json
from os import stat, walk, getcwd, sep, remove
from copy import copy
from time import time, sleep
@ -1299,11 +1300,17 @@ class mbedToolchain:
"""Dump the current build profile and macros into the `.profile` file
in the build directory"""
for key in ["cxx", "c", "asm", "ld"]:
to_dump = (str(self.flags[key]) + str(sorted(self.macros)))
to_dump = {
"flags": sorted(self.flags[key]),
"macros": sorted(self.macros),
"symbols": sorted(self.get_symbols(for_asm=(key == "asm"))),
}
if key in ["cxx", "c"]:
to_dump += str(self.flags['common'])
to_dump["symbols"].remove('MBED_BUILD_TIMESTAMP=%s' % self.timestamp)
to_dump["flags"].extend(sorted(self.flags['common']))
where = join(self.build_dir, self.PROFILE_FILE_NAME + "-" + key)
self._overwrite_when_not_equal(where, to_dump)
self._overwrite_when_not_equal(where, json.dumps(
to_dump, sort_keys=True, indent=4))
@staticmethod
def _overwrite_when_not_equal(filename, content):