mirror of
https://gitee.com/Vancouver2017/luban-lite-t3e-pro.git
synced 2025-12-14 18:38:55 +00:00
52 lines
1.6 KiB
Python
52 lines
1.6 KiB
Python
from building import *
|
|
import os
|
|
|
|
# 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 = []
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
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'))
|
|
|
|
if GetDepend(['AIC_LVGL_UI_BUILDER']):
|
|
ins_src='ui_builder/assets/'
|
|
if GetDepend(['LVGL_STORAGE_PATH']):
|
|
ins_dst = GetDepend('LVGL_STORAGE_PATH').strip('"/')
|
|
else:
|
|
ins_dst='rodata/lvgl_data'
|
|
|
|
install=[(ins_src, ins_dst)]
|
|
group = group + DefineGroup('LVGL-port', src, depend = ['AIC_LVGL_DEMO'], CPPPATH = inc,
|
|
INSTALL = install)
|
|
else:
|
|
group = group + DefineGroup('LVGL-port', src, depend = ['AIC_LVGL_DEMO'], CPPPATH = inc)
|
|
|
|
Return('group')
|