SConscript 744 B

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