awtk/tests/SConscript

56 lines
2.2 KiB
Python
Raw Normal View History

2018-02-21 19:36:38 +08:00
import os
import sys
2021-09-16 14:54:54 +08:00
import platform
2020-04-29 09:10:05 +08:00
import awtk_config as awtk
2018-02-21 19:36:38 +08:00
BIN_DIR=os.environ['BIN_DIR'];
2018-04-27 11:23:09 +08:00
TK_ROOT=os.environ['TK_ROOT'];
TK_3RD_ROOT=os.environ['TK_3RD_ROOT'];
2018-02-21 19:36:38 +08:00
GTEST_ROOT=os.environ['GTEST_ROOT'];
env=DefaultEnvironment().Clone();
2018-04-27 11:23:09 +08:00
INCLUDE_PATH = [TK_ROOT,
2018-02-21 19:36:38 +08:00
GTEST_ROOT,
2018-04-27 11:23:09 +08:00
os.path.join(TK_ROOT, 'src'),
os.path.join(TK_3RD_ROOT, 'SDL/src'),
os.path.join(TK_3RD_ROOT, 'SDL/include'),
2018-07-27 19:12:20 +08:00
os.path.join(TK_ROOT, 'src/ext_widgets'),
2018-10-13 18:40:00 +08:00
os.path.join(TK_ROOT, '3rd/libunibreak'),
2018-02-21 19:36:38 +08:00
os.path.join(GTEST_ROOT, 'src'),
os.path.join(GTEST_ROOT, 'include'),
os.path.join(GTEST_ROOT, 'make')]
env['CPPPATH'] = INCLUDE_PATH
2020-04-29 09:10:05 +08:00
env['LIBS'] = ['assets', 'image_gen', 'theme_gen', 'font_gen', 'str_gen', 'common'] + awtk.STATIC_LIBS
env['LINKFLAGS'] = env['OS_SUBSYSTEM_CONSOLE'] + env['LINKFLAGS'];
2018-02-21 19:36:38 +08:00
SOURCES = [
os.path.join(GTEST_ROOT, 'src/gtest-all.cc'),
] + Glob('*.cc') + Glob('*.c')
2018-03-18 11:29:31 +08:00
env.Program(os.path.join(BIN_DIR, 'runTest'), SOURCES);
2018-12-22 19:04:55 +08:00
env.Program(os.path.join(BIN_DIR, 'recycle_test'), ["recycle_test.cpp"])
2020-02-07 11:19:46 +08:00
env.Program(os.path.join(BIN_DIR, 'waitable_action_queue_test'), ["waitable_action_queue_test.cpp"])
2020-04-02 07:58:24 +08:00
env.Program(os.path.join(BIN_DIR, 'waitable_ring_buffer_test'), ["waitable_ring_buffer_test.cpp"])
2020-02-10 10:13:40 +08:00
env.Program(os.path.join(BIN_DIR, 'action_thread_test'), ["action_thread_test.cpp"])
2021-04-08 11:02:23 +08:00
env.Program(os.path.join(BIN_DIR, 'app_conf_multi_threads'), ["app_conf_multi_threads.cpp"])
2020-02-13 18:25:23 +08:00
#env.Program(os.path.join(BIN_DIR, 'action_thread_pool_test'), ["action_thread_pool_test.cpp"])
2020-10-24 09:43:19 +08:00
env.Program(os.path.join(BIN_DIR, 'json_to_ubjson'), ["json_to_ubjson.cpp"])
env.Program(os.path.join(BIN_DIR, 'ubjson_to_json'), ["ubjson_to_json.cpp"])
2020-11-10 22:06:48 +08:00
env.Program(os.path.join(BIN_DIR, 'runFScript'), ["fscript_run.cpp"])
2021-09-06 18:02:51 +08:00
env.Program(os.path.join(BIN_DIR, 'async_call_test'), ["async_call_test.cpp"])
2018-02-21 19:36:38 +08:00
2020-10-13 09:48:26 +08:00
env.SharedLibrary(os.path.join(BIN_DIR+"/plugins_for_test", 'a'), ["a.c"])
env.SharedLibrary(os.path.join(BIN_DIR+"/plugins_for_test", 'b'), ["b.c"])
2022-01-21 11:06:05 +08:00
OS_NAME = platform.system();
CROSS_COMPILE='CROSS_COMPILE' in os.environ and os.environ['CROSS_COMPILE'] == 'True'
if not CROSS_COMPILE:
LIBS=env['LIBS']
if OS_NAME != 'Windows':
LIBS = LIBS + ['readline']
env.Program(os.path.join(BIN_DIR, 'fdb'), ["fdb.cpp"], LIBS=LIBS);
2018-02-21 19:36:38 +08:00