build/generic_platform: only add sources if language is not None
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 10 Oct 2019 17:39:33 +0000 (19:39 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 10 Oct 2019 17:39:33 +0000 (19:39 +0200)
litex/build/generic_platform.py

index 50af71275d5d39d8f8d72eede471da8357dff8ab..cc5c0221283dea6e31079e476fbb93d27bc54d62 100644 (file)
@@ -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))