mirror of https://github.com/ARMmbed/mbed-os.git
Use hash to determine changes to command files
parent
8292affb53
commit
28064f1319
|
@ -312,12 +312,17 @@ class mbedToolchain:
|
||||||
""" Generate a via file for a pile of defines
|
""" Generate a via file for a pile of defines
|
||||||
ARM, GCC, IAR cross compatible
|
ARM, GCC, IAR cross compatible
|
||||||
"""
|
"""
|
||||||
option_md5 = md5(' '.join(options).encode('utf-8')).hexdigest()
|
to_write = " ".join(options).encode('utf-8')
|
||||||
via_file = join(self.build_dir, naming.format(option_md5))
|
new_md5 = md5(to_write).hexdigest()
|
||||||
if not exists(via_file):
|
via_file = join(self.build_dir, naming.format(new_md5))
|
||||||
|
try:
|
||||||
|
with open(via_file, "r") as fd:
|
||||||
|
old_md5 = md5(fd.read().encode('utf-8')).hexdigest()
|
||||||
|
except IOError:
|
||||||
|
old_md5 = None
|
||||||
|
if old_md5 != new_md5:
|
||||||
with open(via_file, "w") as fd:
|
with open(via_file, "w") as fd:
|
||||||
string = " ".join(options)
|
fd.write(to_write)
|
||||||
fd.write(string)
|
|
||||||
return via_file
|
return via_file
|
||||||
|
|
||||||
def get_inc_file(self, includes):
|
def get_inc_file(self, includes):
|
||||||
|
|
Loading…
Reference in New Issue