[PATCH rtems-littlevgl 3/4] lvgl: Get lv_drivers source list directly from the directory

Vijay Kumar Banerjee vijay at rtems.org
Thu Jun 4 18:44:33 UTC 2020


---
 lvgl.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/lvgl.py b/lvgl.py
index b91a265..08c7c84 100644
--- a/lvgl.py
+++ b/lvgl.py
@@ -31,6 +31,8 @@ import re
 import rtems_waf.rtems as rtems
 
 def source_list(bld):
+    sources = []
+    cflags = []
     mk_files = ['lvgl/src/lv_core/lv_core.mk',
                 'lvgl/src/lv_hal/lv_hal.mk',
                 'lvgl/src/lv_objx/lv_objx.mk',
@@ -39,10 +41,10 @@ def source_list(bld):
                 'lvgl/src/lv_themes/lv_themes.mk',
                 'lvgl/src/lv_draw/lv_draw.mk',
                ]
+
     if bld.env.DRIVERS:
-        mk_files.append('lv_drivers/display/display.mk')
-    sources = []
-    cflags = []
+        drv_path = ['lv_drivers/display', 'lv_drivers/indev']
+        sources = [os.path.join(d, s) for d in drv_path for s in os.listdir(d) if (s[-2:] == '.c')]
 
     for filename in mk_files:
       lexer = shlex.shlex(file(filename, 'rt').read())
@@ -86,7 +88,10 @@ def build(bld):
     arch_inc_path = rtems.arch_bsp_include_path(bld.env.RTEMS_VERSION,
                                                 bld.env.RTEMS_ARCH_BSP)
 
-    include_paths.extend(['lvgl/', 'lv_drivers', 'lvgl/src', '.'])
+    include_paths.extend(['lvgl/', 'lvgl/src', '.'])
+    if bld.env.DRIVERS:
+        include_paths.extend(['lv_drivers/display', 'lv_drivers/indev'])
+
     for include_path in include_paths:
         files = os.listdir(include_path)
         include_headers = [os.path.join(include_path, x) for x in files if (x[-2:] == '.h')]
-- 
2.21.1



More information about the devel mailing list