diff --git a/litex/build/generic_platform.py b/litex/build/generic_platform.py index 772f77a1e..65d706658 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):