mirror of https://github.com/ARMmbed/mbed-os.git
Use toolchain notify for printing when finding dupes
parent
9bf20486ec
commit
e012185602
|
@ -452,7 +452,7 @@ def build_project(src_paths, build_path, target, toolchain_name,
|
|||
# Link Program
|
||||
res, _ = toolchain.link_program(resources, build_path, name)
|
||||
|
||||
resources.detect_duplicates()
|
||||
resources.detect_duplicates(toolchain)
|
||||
|
||||
if report != None:
|
||||
end = time()
|
||||
|
|
|
@ -22,5 +22,5 @@ if __name__ == "__main__":
|
|||
|
||||
scanned_files = {}
|
||||
|
||||
exit(resources.detect_duplicates())
|
||||
exit(resources.detect_duplicates(toolchain))
|
||||
|
||||
|
|
|
@ -133,21 +133,21 @@ class Resources:
|
|||
res._collect_duplicates(dupe_dict, dupe_headers)
|
||||
return dupe_dict, dupe_headers
|
||||
|
||||
def detect_duplicates(self):
|
||||
def detect_duplicates(self, toolchain):
|
||||
count = 0
|
||||
dupe_dict, dupe_headers = self._collect_duplicates(dict(), dict())
|
||||
for objname, filenames in dupe_dict.iteritems():
|
||||
if len(filenames) > 1:
|
||||
count+=1
|
||||
print "[ERROR] Object file %s.o is not unique!"\
|
||||
" It could be made from:" % objname
|
||||
print columnate(filenames)
|
||||
toolchain.tool_error(
|
||||
"Object file %s.o is not unique! It could be made from: %s"\
|
||||
% (objname, " ".join(filenames)))
|
||||
for headername, locations in dupe_headers.iteritems():
|
||||
if len(locations) > 1:
|
||||
count+=1
|
||||
print "[ERROR] Header file %s is not unique! It could be:" %\
|
||||
headername
|
||||
print columnate(locations)
|
||||
toolchain.tool_error(
|
||||
"Header file %s is not unique! It could be: %s" %\
|
||||
(headername, " ".join(locations)))
|
||||
return count
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue