From ed3c53d7cd2afd1fe18400064c252151cb237ac3 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 10 Oct 2019 19:39:33 +0200 Subject: [PATCH] build/generic_platform: only add sources if language is not None --- litex/build/generic_platform.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)) -- 2.30.2