awtk/armlinux

90 lines
2.6 KiB
Plaintext
Raw Normal View History

2018-06-11 17:36:54 +08:00
import os
import platform
TOOLS_PREFIX='/root/armgcc/arm-fsl-linux-gnueabi/bin/arm-linux-'
OS_NAME=platform.system()
TK_ROOT = os.path.normpath(os.getcwd())
TK_SRC = os.path.join(TK_ROOT, 'src')
TK_3RD_ROOT = os.path.join(TK_ROOT, '3rd')
TK_TOOLS_ROOT = os.path.join(TK_ROOT, 'tools')
GTEST_ROOT = os.path.join(TK_ROOT, '3rd/gtest/googletest')
BIN_DIR=os.path.join(TK_ROOT, 'bin')
LIB_DIR=os.path.join(TK_ROOT, 'lib')
LCD='FB'
VGCANVAS='PICASSO'
FRAME_BUFFER_FORMAT='rgba8888'
FRAME_BUFFER_FORMAT='rgb565'
COMMON_CCFLAGS=' -DTK_ROOT=\\\"'+TK_ROOT+'\\\" -DHAS_STD_MALLOC -DWITH_FS_RES -DHAS_STDIO'
COMMON_CCFLAGS=COMMON_CCFLAGS+' -DLUA_COMPAT_MODULE -DSTBTT_STATIC -DSTB_IMAGE_STATIC -DWITH_STB_IMAGE -DWITH_STB_FONT -DWITH_DYNAMIC_TR'
COMMON_CCFLAGS = COMMON_CCFLAGS + ' -DWITH_PICASSO -DIMAGE_RGBA'
COMMON_CCFLAGS = COMMON_CCFLAGS + ' -DWITH_BITMAP_RGB565'
os.environ['LCD'] = LCD
os.environ['VGCANVAS'] =VGCANVAS
os.environ['BIN_DIR'] = BIN_DIR;
os.environ['LIB_DIR'] = LIB_DIR;
os.environ['TK_ROOT'] = TK_ROOT;
os.environ['GTEST_ROOT'] = GTEST_ROOT;
os.environ['FRAME_BUFFER_FORMAT'] = FRAME_BUFFER_FORMAT;
OS_LIBPATH=[]
OS_CPPPATH=[]
OS_FLAGS='-g -Wall'
OS_SUBSYSTEM_CONSOLE=''
OS_SUBSYSTEM_WINDOWS=''
OS_LINKFLAGS=''
OS_LIBS=['stdc++', 'pthread', 'm']
OS_LIBS = ['GL'] + OS_LIBS + ['dl']
COMMON_CCFLAGS = COMMON_CCFLAGS + ' -DLUA_USE_POSIX -DLINUX -DHAS_PTHREAD'
OS_LIBS = ['freetype'] + OS_LIBS
COMMON_CCFLAGS = COMMON_CCFLAGS + ' -DENABLE_FREE_TYPE2=1 -DFONT_FILE_NAME=\\\"'+TK_ROOT+'/demos/res/raw/fonts/default_ttf.ttf\\\"'
LIBS=['awtk', 'picasso'] + OS_LIBS
CCFLAGS=OS_FLAGS + COMMON_CCFLAGS
CPPPATH=[TK_ROOT,
TK_SRC,
TK_3RD_ROOT,
os.path.join(TK_3RD_ROOT, 'nanovg/src'),
os.path.join(TK_3RD_ROOT, 'agg/include'),
os.path.join(TK_3RD_ROOT, 'picasso/src'),
os.path.join(TK_3RD_ROOT, 'picasso/build'),
os.path.join(TK_3RD_ROOT, 'picasso/include'),
os.path.join(TK_3RD_ROOT, 'picasso/src/gfx'),
os.path.join(TK_3RD_ROOT, 'picasso/src/include'),
os.path.join(TK_3RD_ROOT, 'freetype2/include'),
TK_TOOLS_ROOT] + OS_CPPPATH
DefaultEnvironment(
CC=TOOLS_PREFIX+'gcc',
CXX=TOOLS_PREFIX+'g++',
LD=TOOLS_PREFIX+'g++',
AR=TOOLS_PREFIX+'ar',
STRIP=TOOLS_PREFIX+'strip',
CCFLAGS = CCFLAGS,
CPPPATH = CPPPATH,
LIBS=LIBS,
LINKFLAGS=OS_LINKFLAGS,
OS_SUBSYSTEM_CONSOLE=OS_SUBSYSTEM_CONSOLE,
OS_SUBSYSTEM_WINDOWS=OS_SUBSYSTEM_WINDOWS,
LIBPATH=[os.path.join(TK_ROOT, 'lib')] + OS_LIBPATH)
SConscriptFiles=[
'3rd/lua/SConscript',
'3rd/picasso/SConscript',
'src/SConscript',
'demos/SConscript',
'lua/SConscript'
]
SConscript(SConscriptFiles)