2021-10-12 10:35:37 -05:00
|
|
|
from building import *
|
2021-10-18 07:55:20 -05:00
|
|
|
import rtconfig
|
|
|
|
import os
|
|
|
|
import shutil
|
2021-10-12 10:35:37 -05:00
|
|
|
|
2021-10-18 07:55:20 -05:00
|
|
|
# get current dir path
|
2021-10-12 10:35:37 -05:00
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
2021-10-18 07:55:20 -05:00
|
|
|
src = []
|
|
|
|
inc = []
|
|
|
|
|
2022-01-19 16:10:54 -05:00
|
|
|
lvgl_cwd = cwd + '/../../'
|
2021-10-18 07:55:20 -05:00
|
|
|
|
2021-12-20 03:52:07 -05:00
|
|
|
lvgl_src_cwd = lvgl_cwd + 'src/'
|
2021-10-18 07:55:20 -05:00
|
|
|
inc = inc + [lvgl_src_cwd]
|
|
|
|
for root, dirs, files in os.walk(lvgl_src_cwd):
|
|
|
|
for dir in dirs:
|
|
|
|
src = src + Glob(os.path.join(root,dir,'*.c'))
|
|
|
|
inc = inc + [os.path.join(root,dir)]
|
|
|
|
|
2021-12-20 03:52:07 -05:00
|
|
|
if GetDepend('PKG_USING_LVGL_EXAMPLES'):
|
|
|
|
lvgl_src_cwd = lvgl_cwd + 'examples/'
|
|
|
|
inc = inc + [lvgl_src_cwd]
|
|
|
|
for root, dirs, files in os.walk(lvgl_src_cwd):
|
|
|
|
for dir in dirs:
|
|
|
|
src = src + Glob(os.path.join(root,dir,'*.c'))
|
|
|
|
inc = inc + [os.path.join(root,dir)]
|
|
|
|
|
2022-01-19 16:10:54 -05:00
|
|
|
if GetDepend('PKG_USING_LVGL_DEMOS'):
|
|
|
|
lvgl_src_cwd = lvgl_cwd + 'demos/'
|
|
|
|
inc = inc + [lvgl_src_cwd]
|
|
|
|
for root, dirs, files in os.walk(lvgl_src_cwd):
|
|
|
|
for dir in dirs:
|
|
|
|
src = src + Glob(os.path.join(root,dir,'*.c'))
|
|
|
|
inc = inc + [os.path.join(root,dir)]
|
|
|
|
|
2021-10-22 05:13:39 -04:00
|
|
|
LOCAL_CCFLAGS = ''
|
2021-10-26 10:38:50 -04:00
|
|
|
if rtconfig.PLATFORM == 'gcc': # GCC
|
2021-10-18 07:55:20 -05:00
|
|
|
LOCAL_CCFLAGS += ' -std=c99'
|
2021-10-26 10:38:50 -04:00
|
|
|
elif rtconfig.PLATFORM == 'armcc': # Keil AC5
|
2021-10-18 07:55:20 -05:00
|
|
|
LOCAL_CCFLAGS += ' --c99 --gnu -g -W'
|
2021-10-26 10:38:50 -04:00
|
|
|
elif rtconfig.PLATFORM == 'armclang': # Keil AC6
|
|
|
|
LOCAL_CCFLAGS += ' -std=c99 -g -w'
|
2021-10-18 07:55:20 -05:00
|
|
|
|
|
|
|
group = DefineGroup('LVGL', src, depend = ['PKG_USING_LVGL'], CPPPATH = inc, LOCAL_CCFLAGS = LOCAL_CCFLAGS)
|
|
|
|
|
2021-10-22 05:13:39 -04:00
|
|
|
port_src = Glob('*.c')
|
|
|
|
port_inc = [cwd]
|
|
|
|
group = group + DefineGroup('LVGL-port', port_src, depend = ['PKG_USING_LVGL'], CPPPATH = port_inc)
|
|
|
|
|
2021-10-18 07:55:20 -05:00
|
|
|
list = os.listdir(cwd)
|
2021-10-12 10:35:37 -05:00
|
|
|
for d in list:
|
|
|
|
path = os.path.join(cwd, d)
|
|
|
|
if os.path.isfile(os.path.join(path, 'SConscript')):
|
2021-10-18 07:55:20 -05:00
|
|
|
group = group + SConscript(os.path.join(d, 'SConscript'))
|
|
|
|
|
|
|
|
#
|
|
|
|
# try:
|
|
|
|
# shutil.rmtree(os.path.join(lvgl_cwd, '.github'))
|
|
|
|
# shutil.rmtree(os.path.join(lvgl_cwd, 'docs'))
|
|
|
|
# shutil.rmtree(os.path.join(lvgl_cwd, 'scripts'))
|
|
|
|
# shutil.rmtree(os.path.join(lvgl_cwd, 'tests'))
|
|
|
|
# shutil.rmtree(os.path.join(lvgl_cwd, 'zephyr'))
|
|
|
|
# os.remove(os.path.join(lvgl_cwd, '.codecov.yml'))
|
|
|
|
# os.remove(os.path.join(lvgl_cwd, '.editorconfig'))
|
|
|
|
# os.remove(os.path.join(lvgl_cwd, '.gitignore'))
|
|
|
|
# os.remove(os.path.join(lvgl_cwd, '.gitmodules'))
|
|
|
|
# os.remove(os.path.join(lvgl_cwd, 'CMakeLists.txt'))
|
|
|
|
# os.remove(os.path.join(lvgl_cwd, 'component.mk'))
|
|
|
|
# os.remove(os.path.join(lvgl_cwd, 'idf_component.yml'))
|
|
|
|
# os.remove(os.path.join(lvgl_cwd, 'Kconfig'))
|
|
|
|
# os.remove(os.path.join(lvgl_cwd, 'library.json'))
|
|
|
|
# os.remove(os.path.join(lvgl_cwd, 'library.properties'))
|
|
|
|
# os.remove(os.path.join(lvgl_cwd, 'lv_conf_template.h'))
|
|
|
|
# os.remove(os.path.join(lvgl_cwd, 'lvgl.mk'))
|
|
|
|
# except:
|
|
|
|
# pass
|
|
|
|
#
|
2021-10-12 10:35:37 -05:00
|
|
|
|
2021-10-18 07:55:20 -05:00
|
|
|
Return('group')
|