awtk/SConstruct

101 lines
2.8 KiB
Python
Raw Normal View History

2018-02-21 19:36:38 +08:00
import os
2023-08-25 17:10:16 +08:00
import atexit
2023-01-05 18:05:49 +08:00
import platform
2023-08-25 17:10:16 +08:00
import sys
sys.path.insert(0, './scripts')
import compile_config
complie_helper = compile_config.complie_helper()
complie_helper.try_load_default_config()
complie_helper.scons_user_sopt(ARGUMENTS)
compile_config.set_curr_config(complie_helper)
2019-02-25 17:45:05 +08:00
import awtk_config as awtk
2019-09-01 17:58:51 +08:00
APP_TOOLS = None
2023-01-05 18:05:49 +08:00
OS_NAME = platform.system()
2023-03-09 17:46:55 +08:00
awtk.scons_db_check_and_remove()
2023-01-05 18:05:49 +08:00
2019-09-01 17:58:51 +08:00
if awtk.TOOLS_NAME != '' :
2023-01-05 18:05:49 +08:00
if awtk.TOOLS_NAME == 'mingw':
2023-01-04 17:48:00 +08:00
APP_TOOLS = ['mingw']
2023-01-05 18:05:49 +08:00
elif awtk.TOOLS_NAME == '' and OS_NAME == 'Windows':
APP_TOOLS = ['msvc', 'masm', 'mslink', "mslib"]
2019-09-01 17:58:51 +08:00
2020-12-26 22:24:26 +08:00
awtk.genIdlAndDef();
2019-09-01 17:58:51 +08:00
DefaultEnvironment(TOOLS = APP_TOOLS,
2023-08-25 17:10:16 +08:00
CCFLAGS = awtk.AWTK_CCFLAGS + awtk.BUILD_DEBUG_FLAG,
2020-04-28 18:01:07 +08:00
LIBS = awtk.LIBS,
2019-09-01 17:58:51 +08:00
LIBPATH = awtk.LIBPATH,
2020-08-17 10:46:54 +08:00
CPPPATH = awtk.CPPPATH + [awtk.joinPath(awtk.TK_ROOT, 'res')],
2023-08-25 17:10:16 +08:00
LINKFLAGS = awtk.LINKFLAGS + awtk.BUILD_DEBUG_LINKFLAGS,
2019-09-01 17:58:51 +08:00
TARGET_ARCH=awtk.TARGET_ARCH,
OS_SUBSYSTEM_CONSOLE=awtk.OS_SUBSYSTEM_CONSOLE,
OS_SUBSYSTEM_WINDOWS=awtk.OS_SUBSYSTEM_WINDOWS
)
2018-02-21 19:36:38 +08:00
2019-02-25 17:45:05 +08:00
SConscriptFiles=awtk.NANOVG_BACKEND_PROJS + [
2020-03-18 07:27:19 +08:00
'3rd/cjson/SConscript',
2021-03-25 17:16:12 +08:00
'3rd/mbedtls/SConscript',
2018-04-13 13:54:36 +08:00
'3rd/glad/SConscript',
2018-06-24 12:23:51 +08:00
'3rd/gpinyin/SConscript',
2022-11-15 11:42:33 +08:00
'3rd/svgtiny/SConscript',
2018-07-27 10:50:05 +08:00
'3rd/libunibreak/SConscript',
2019-10-12 07:31:26 +08:00
'3rd/lz4/SConscript',
'3rd/miniz/SConscript',
'3rd/fribidi/SConscript',
2022-07-19 16:47:02 +08:00
'3rd/nativefiledialog/SConscript',
2018-03-18 11:29:31 +08:00
'src/SConscript',
2021-01-21 21:52:18 +08:00
'src/csv/SConscript',
2020-06-07 09:50:36 +08:00
'src/conf_io/SConscript',
2021-02-04 13:51:45 +08:00
'src/hal/SConscript',
2019-09-12 12:08:35 +08:00
'src/streams/SConscript',
2019-10-12 17:28:15 +08:00
'src/compressors/SConscript',
2019-09-14 18:16:47 +08:00
'src/ubjson/SConscript',
2022-01-21 11:34:58 +08:00
'src/debugger/SConscript',
2021-12-02 16:52:58 +08:00
'src/fscript_ext/SConscript',
'src/xml/SConscript',
'src/charset/SConscript',
2023-07-27 21:45:43 +08:00
'src/romfs/SConscript',
2023-08-25 17:10:16 +08:00
]
os.environ['BUILD_TOOLS'] = str(complie_helper.get_value('BUILD_TOOLS', True))
if complie_helper.get_value('BUILD_TOOLS', True) :
SConscriptFiles += [
'src/streams/tools/SConscript',
'tools/common/SConscript',
'tools/theme_gen/SConscript',
'tools/font_gen/SConscript',
'tools/image_gen/SConscript',
'tools/image_resize/SConscript',
'tools/image_dither/SConscript',
'tools/res_gen/SConscript',
'tools/str_gen/SConscript',
'tools/ui_gen/xml_to_ui/SConscript',
'tools/svg_gen/SConscript',
'tools/api_doc_lint/SConscript',
'tools/preview_ui/SConscript',
'tools/fdb/SConscript',
'tools/dltest/SConscript',
'src/hal/tools/network_shell/SConscript',
]
if complie_helper.get_value('BUILD_DEMOS', True) :
SConscriptFiles += ['demos/SConscript']
if complie_helper.get_value('BUILD_TESTS', True) :
SConscriptFiles += ['tests/SConscript']
SConscriptFiles += awtk.OS_PROJECTS
2019-02-25 17:45:05 +08:00
os.environ['TK_ROOT'] = awtk.TK_ROOT;
os.environ['BIN_DIR'] = awtk.TK_BIN_DIR;
os.environ['LIB_DIR'] = awtk.TK_LIB_DIR;
2023-03-02 18:28:06 +08:00
os.environ['AWTK_SHARED_LIBS'] = ';'.join(awtk.SHARED_LIBS);
2019-02-25 17:45:05 +08:00
2018-05-10 13:47:39 +08:00
SConscript(SConscriptFiles)
2023-08-25 17:10:16 +08:00
def compile_end() :
complie_helper.output_compile_data(awtk.TK_ROOT)
atexit.register(compile_end)