build/generic_platform/add_source: Tranform filename to absolute path earlier to catch duplications when relative/absolute paths are used in design.

This commit is contained in:
Florent Kermarrec 2021-11-29 14:03:33 +01:00
parent f2319d39d4
commit aebef65932

View file

@ -368,6 +368,7 @@ class GenericPlatform:
pass pass
def add_source(self, filename, language=None, library=None): def add_source(self, filename, language=None, library=None):
filename = os.path.abspath(filename)
if language is None: if language is None:
language = tools.language_by_filename(filename) language = tools.language_by_filename(filename)
if library is None: if library is None:
@ -375,7 +376,7 @@ class GenericPlatform:
for f, _, _ in self.sources: for f, _, _ in self.sources:
if f == filename: if f == filename:
return return
self.sources.append((os.path.abspath(filename), language, library)) self.sources.append((filename, language, library))
def add_sources(self, path, *filenames, language=None, library=None): def add_sources(self, path, *filenames, language=None, library=None):
for f in filenames: for f in filenames: