From d2cb344c91627aeec6b27b6bea0dfdc3832f3ee9 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 14 Mar 2015 00:49:10 +0200 Subject: [PATCH] Remove duplicate entries from list of source files. --- build.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 85f6edf00..fff3d11c4 100644 --- a/build.py +++ b/build.py @@ -203,12 +203,15 @@ class BuildTarget(): def process_sourcelist(self, sources): if not isinstance(sources, list): sources = [sources] + added_sources = {} # If the same source is defined multiple times, use it only once. for s in sources: # Holder unpacking. Ugly. if hasattr(s, 'held_object'): s = s.held_object if isinstance(s, str): - self.sources.append(s) + if not s in added_sources: + self.sources.append(s) + added_sources[s] = True elif isinstance(s, GeneratedList) or isinstance(s, CustomTarget): self.generated.append(s) else: