Use toolchain notify for printing when finding dupes

pull/2854/head
Jimmy Brisson 2016-09-30 14:41:11 -05:00
parent 9bf20486ec
commit e012185602
3 changed files with 9 additions and 9 deletions

View File

@ -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()

View File

@ -22,5 +22,5 @@ if __name__ == "__main__":
scanned_files = {}
exit(resources.detect_duplicates())
exit(resources.detect_duplicates(toolchain))

View File

@ -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