mirror of
https://gitee.com/Vancouver2017/luban-lite-t3e-pro.git
synced 2025-12-16 03:18:54 +00:00
lvgl ui support AiUIBuilder
This commit is contained in:
@@ -1,17 +1,40 @@
|
||||
from building import *
|
||||
import os
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
# check if .h or .hpp files exist
|
||||
def check_h_hpp_exist(path):
|
||||
file_dirs = os.listdir(path)
|
||||
for file_dir in file_dirs:
|
||||
if os.path.splitext(file_dir)[1] in ['.h', '.hpp']:
|
||||
return True
|
||||
return False
|
||||
|
||||
src = []
|
||||
inc = []
|
||||
group = []
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd]
|
||||
|
||||
list = os.listdir(cwd)
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(d, 'SConscript'))
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
group = group + DefineGroup('LVGL-port', src, depend = ['AIC_LVGL_DEMO'], CPPPATH = CPPPATH)
|
||||
if GetDepend(['AIC_LVGL_UI_BUILDER']):
|
||||
ui_path = 'ui_builder/'
|
||||
src = Glob(ui_path + '*.c')
|
||||
lvgl_cwd = cwd + '/'
|
||||
lvgl_src_cwd = lvgl_cwd + ui_path
|
||||
inc = inc + [lvgl_src_cwd]
|
||||
for root, dirs, files in os.walk(lvgl_src_cwd):
|
||||
for dir in dirs:
|
||||
current_path = os.path.join(root, dir)
|
||||
rela_path = current_path.replace(lvgl_cwd, '')
|
||||
src = src + Glob(rela_path + '/*.c') # add all .c files
|
||||
if check_h_hpp_exist(current_path): # add .h and .hpp path
|
||||
inc = inc + [current_path]
|
||||
else:
|
||||
list = os.listdir(cwd)
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
group = group + DefineGroup('LVGL-port', src, depend = ['AIC_LVGL_DEMO'], CPPPATH = inc)
|
||||
|
||||
Return('group')
|
||||
|
||||
Reference in New Issue
Block a user