awtk/3rd/nanovg/SConscript

51 lines
2.3 KiB
Python
Raw Normal View History

2018-04-13 10:25:58 +08:00
import os
2018-11-09 18:46:34 +08:00
import platform
2018-04-13 10:25:58 +08:00
2018-11-09 18:46:34 +08:00
def joinPath(root, subdir):
return os.path.normpath(os.path.join(root, subdir))
2018-04-13 10:25:58 +08:00
env=DefaultEnvironment().Clone()
LIB_DIR=os.environ['LIB_DIR'];
2018-10-13 18:40:00 +08:00
BIN_DIR=os.environ['BIN_DIR'];
2018-11-09 18:46:34 +08:00
CCFLAGS=os.environ['CCFLAGS'];
TK_3RD_ROOT=os.environ['TK_3RD_ROOT'];
OS_NAME=platform.system()
2018-10-15 16:19:26 +08:00
2018-10-13 18:40:00 +08:00
env.Library(os.path.join(LIB_DIR, 'nanovg'), Glob('base/*.c'))
env['LINKFLAGS'] = env['OS_SUBSYSTEM_CONSOLE'] + env['LINKFLAGS'];
2018-04-13 10:25:58 +08:00
2018-10-15 16:19:26 +08:00
NANOVG_BACKEND=os.environ['NANOVG_BACKEND'];
if NANOVG_BACKEND == 'AGG':
env.Library(os.path.join(LIB_DIR, 'nanovg-agg'), Glob('agg/*.cpp'))
2019-06-27 15:28:57 +08:00
# env['LIBS'] = ['nanovg-agg', 'agg', 'nanovg'] + env['LIBS']
# env.Program(os.path.join(BIN_DIR, 'agg_stroke'), Glob('demos/agg_stroke.c'));
# env.Program(os.path.join(BIN_DIR, 'agg_fill'), Glob('demos/agg_fill.c'));
# env.Program(os.path.join(BIN_DIR, 'agg_draw_image'), Glob('demos/agg_draw_image.c'));
2018-10-15 16:19:26 +08:00
elif NANOVG_BACKEND == 'AGGE':
env.Library(os.path.join(LIB_DIR, 'nanovg-agge'), Glob('agge/*.cpp'))
2019-06-27 15:28:57 +08:00
# env['LIBS'] = ['nanovg-agge', 'agge', 'nanovg'] + env['LIBS']
# env.Program(os.path.join(BIN_DIR, 'agge_stroke'), Glob('demos/agge_stroke.c'));
# env.Program(os.path.join(BIN_DIR, 'agge_fill'), Glob('demos/agge_fill.c'));
# env.Program(os.path.join(BIN_DIR, 'agge_draw_image'), Glob('demos/agge_draw_image.c'));
2018-10-15 16:19:26 +08:00
elif NANOVG_BACKEND == 'BGFX':
2018-11-09 18:46:34 +08:00
CPPPATH = [
joinPath(TK_3RD_ROOT, 'nanovg/base'),
joinPath(TK_3RD_ROOT, 'bgfx/bx/include'),
joinPath(TK_3RD_ROOT, 'bgfx/bgfx/include'),
joinPath(TK_3RD_ROOT, 'SDL/include')]
if OS_NAME == 'Darwin':
2018-11-27 15:15:48 +08:00
CCFLAGS = CCFLAGS + ' -std=c++14 '
2018-11-09 18:46:34 +08:00
elif OS_NAME == 'Windows':
2018-11-28 10:09:01 +08:00
CCFLAGS = CCFLAGS + ' /std:c++14 ';
2018-11-09 18:46:34 +08:00
CPPPATH = CPPPATH + [joinPath(TK_3RD_ROOT, 'bgfx/bx/include/compat/msvc')];
env.Library(os.path.join(LIB_DIR, 'nanovg-bgfx'), Glob('bgfx/*.cpp'), CPPPATH = CPPPATH, CCFLAGS = CCFLAGS)
2018-10-13 18:40:00 +08:00
2019-05-22 09:21:03 +08:00
# env['LIBS'] = ['nanovg-bgfx', 'bgfx', 'nanovg'] + env['LIBS']
# env.Program(os.path.join(BIN_DIR, 'bgfx_sdl_fill'), Glob('demos/bgfx_sdl_fill.cpp'));
# env.Program(os.path.join(BIN_DIR, 'bgfx_sdl_stroke'), Glob('demos/bgfx_sdl_stroke.cpp'));
# env.Program(os.path.join(BIN_DIR, 'bgfx_sdl_draw_image'), Glob('demos/bgfx_sdl_draw_image.cpp'));
# env.Program(os.path.join(BIN_DIR, 'bgfx_sdl_draw_text'), Glob('demos/bgfx_sdl_draw_text.cpp'));
2018-10-13 18:40:00 +08:00