1from building import *
2
3cwd = GetCurrentDir()
4src = Glob('*.c')
5inc = [cwd]
6
7# check if .h or .hpp files exists
8def check_h_hpp_exists(path):
9    file_dirs = os.listdir(path)
10    for file_dir in file_dirs:
11        if os.path.splitext(file_dir)[1] in ['.h', '.hpp']:
12            return True
13    return False
14
15sls_src_cwd = cwd
16for root, dirs, files in os.walk(sls_src_cwd):
17    for dir in dirs:
18        current_path = os.path.join(root, dir)
19        src = src + Glob(os.path.join(current_path,'*.c')) # add all .c files
20        if check_h_hpp_exists(current_path): # add .h and .hpp path
21            inc = inc + [current_path]
22
23group = DefineGroup('LVGL-SquareLine', src, depend = ['PKG_USING_LVGL_SQUARELINE'], CPPPATH = inc)
24
25Return('group')
26