From: Florent Kermarrec Date: Fri, 22 Nov 2019 14:28:07 +0000 (+0100) Subject: build/generic_platform: avoid duplicate in GenericPlatform.sources X-Git-Tag: 24jan2021_ls180~842 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bdaca40fe4ff1d6b5e49f595a82c3a8a6e5da0da;p=litex.git build/generic_platform: avoid duplicate in GenericPlatform.sources --- diff --git a/litex/build/generic_platform.py b/litex/build/generic_platform.py index 772f77a1..65d70665 100644 --- a/litex/build/generic_platform.py +++ b/litex/build/generic_platform.py @@ -325,7 +325,9 @@ class GenericPlatform: language = tools.language_by_filename(filename) if library is None: library = "work" - + for f, _, _ in self.sources: + if f == filename: + return self.sources.append((os.path.abspath(filename), language, library)) def add_sources(self, path, *filenames, language=None, library=None):