mirror of
https://gitee.com/Vancouver2017/luban-lite-t3e-pro.git
synced 2025-12-16 03:18:54 +00:00
v1.1.0
This commit is contained in:
67
packages/artinchip/lvgl-ui/lvgl_v9/lvgl/SConscript
Normal file
67
packages/artinchip/lvgl-ui/lvgl_v9/lvgl/SConscript
Normal file
@@ -0,0 +1,67 @@
|
||||
Import('AIC_ROOT')
|
||||
Import('PRJ_OUT_DIR')
|
||||
from building import *
|
||||
import rtconfig
|
||||
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() # get current dir path
|
||||
|
||||
src = Glob('env_support/rt-thread/*.c')
|
||||
src += Glob('src/*.c')
|
||||
inc = [cwd + '/env_support/rt-thread/']
|
||||
|
||||
lvgl_cwd = cwd + '/'
|
||||
|
||||
lvgl_src_cwd = lvgl_cwd + 'src/'
|
||||
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]
|
||||
|
||||
if GetDepend('LPKG_LVGL_USING_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:
|
||||
current_path = os.path.join(root, dir)
|
||||
rela_path = current_path.replace(lvgl_cwd, '')
|
||||
src = src + Glob(rela_path + '/*.c')
|
||||
if check_h_hpp_exist(current_path):
|
||||
inc = inc + [current_path]
|
||||
|
||||
if GetDepend('LPKG_LVGL_USING_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:
|
||||
current_path = os.path.join(root, dir)
|
||||
rela_path = current_path.replace(lvgl_cwd, '')
|
||||
src = src + Glob(rela_path + '/*.c')
|
||||
if check_h_hpp_exist(current_path):
|
||||
inc = inc + [current_path]
|
||||
|
||||
LOCAL_CFLAGS = ''
|
||||
if rtconfig.PLATFORM == 'gcc' or rtconfig.PLATFORM == 'armclang': # GCC or Keil AC6
|
||||
LOCAL_CFLAGS += ' -std=c99'
|
||||
elif rtconfig.PLATFORM == 'armcc': # Keil AC5
|
||||
LOCAL_CFLAGS += ' --c99 --gnu'
|
||||
|
||||
group = group + DefineGroup('LVGL', src, depend = ['LPKG_USING_LVGL'], CPPPATH = inc, LOCAL_CFLAGS = LOCAL_CFLAGS)
|
||||
|
||||
Return('group')
|
||||
Reference in New Issue
Block a user