from building import *
import rtconfig
import os

src = []
inc = []
cwd = GetCurrentDir() # get current dir path

src+=Glob('*.c')
inc+= [cwd]


#Add resources.
# Ensure directory is created before any builder is executed
# If the path is not present, it would not be added in "include path" and 'lang_pack.h' dependency would not work
Execute(Mkdir('resource/strings'))
src.extend(SConscript(os.path.join(cwd, 'resource/images/SConscript'), variant_dir="resource/images", duplicate=0))
src.extend(SConscript(os.path.join(cwd, 'resource/fonts/SConscript'), variant_dir="resource/fonts", duplicate=0))
src.extend(SConscript(os.path.join(cwd, 'resource/strings/SConscript'), variant_dir="resource/strings", duplicate=0))

#Add GUI applications
app_objs = SConscript(os.path.join(cwd, 'gui_apps/SConscript'), variant_dir="gui_apps", duplicate=0)

src.extend(app_objs)

# #Add applications utils
src.extend(SConscript(os.path.join(cwd, 'app_utils/SConscript'), variant_dir="app_utils", duplicate=0))

group = DefineGroup('app', src, depend = ['PKG_USING_LITTLEVGL2RTT'], CPPPATH = inc)
Return('group')
