build/generic_platform: avoid duplicate in GenericPlatform.sources

This commit is contained in:
Florent Kermarrec 2019-11-22 15:28:07 +01:00
parent 6883a43680
commit bdaca40fe4
1 changed files with 3 additions and 1 deletions

View File

@ -325,7 +325,9 @@ class GenericPlatform:
language = tools.language_by_filename(filename) language = tools.language_by_filename(filename)
if library is None: if library is None:
library = "work" library = "work"
for f, _, _ in self.sources:
if f == filename:
return
self.sources.append((os.path.abspath(filename), language, library)) self.sources.append((os.path.abspath(filename), language, library))
def add_sources(self, path, *filenames, language=None, library=None): def add_sources(self, path, *filenames, language=None, library=None):