From: Florent Kermarrec Date: Thu, 10 Oct 2019 17:39:33 +0000 (+0200) Subject: build/generic_platform: only add sources if language is not None X-Git-Tag: 24jan2021_ls180~926 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ed3c53d7cd2afd1fe18400064c252151cb237ac3;p=litex.git build/generic_platform: only add sources if language is not None --- diff --git a/litex/build/generic_platform.py b/litex/build/generic_platform.py index 50af7127..cc5c0221 100644 --- a/litex/build/generic_platform.py +++ b/litex/build/generic_platform.py @@ -345,7 +345,11 @@ class GenericPlatform: if os.path.isfile(os.path.join(path, item)): dir_files.append(os.path.join(path, item)) for filename in dir_files: - self.add_source(filename, language, library) + _language = language + if _language is None: + _language = tools.language_by_filename(filename) + if _language is not None: + self.add_source(filename, _language, library) def add_verilog_include_path(self, path): self.verilog_include_paths.add(os.path.abspath(path))