improve build scripts

This commit is contained in:
lixianjing 2023-09-08 17:22:29 +08:00
parent bf6e058d20
commit 2dc59f8778
4 changed files with 20 additions and 0 deletions

View File

@ -21,6 +21,10 @@ if not os.path.exists(WIN32_AWTK_RES):
else:
WIN32_AWTK_RES = os.path.join(TK_ROOT, 'win32_res/awtk.res')
WIN32_AWTK_RES = complie_helper.get_value('WIN32_RES', WIN32_AWTK_RES)
if not os.path.isabs(WIN32_AWTK_RES) :
WIN32_AWTK_RES = os.path.join(compile_config.get_curr_app_root(), WIN32_AWTK_RES)
AWTK_STATIC_LIBS = ['awtk_global', 'fscript_ext_widgets', 'extwidgets', 'nfd',
'widgets', 'base', 'gpinyin', 'fribidi', 'linebreak', 'svgtiny']
AWTK_STATIC_LIBS = AWTK_STATIC_LIBS+TKC_STATIC_LIBS

View File

@ -1,4 +1,8 @@
# 最新动态
2023/09/08
* 给APP的编译参数增加WIN32_RES参数(感谢智明提供补丁)
2023/09/07
* 统一宏TK\_STRDUP和TK\_STRNDUP与对应接口的行为(感谢雨欣提供补丁)

View File

@ -41,6 +41,7 @@ COMPILE_CONFIG = {
'FONT' : { 'value' : '', 'save_file' : False, 'desc' : ['app\'s font\'s name'], 'help_info' : 'app\'s font\'s name, FONT=XXXXX ' },
'THEME' : { 'value' : '', 'save_file' : False, 'desc' : ['app\'s default\'s theme\'s name'], 'help_info' : 'app\'s default\'s theme\'s name, THEME=XXXXX ' },
'RES_ROOT' : { 'value' : '', 'save_file' : False, 'desc' : ['app\'s res root'], 'help_info' : 'app\'s res root, RES_ROOT=XXXXX ' },
'WIN32_RES' : { 'value' : '', 'desc' : ['app\'s win32 res path'], 'help_info' : 'app\'s win32 res path, WIN32_RES=XXXXX, value\'s default=\'awtk/win32_res/awtk.res\' ' },
}
def set_compile_config(config) :
@ -338,6 +339,7 @@ class AppHelperBase:
os.chdir(self.AWTK_ROOT)
compile_config.set_curr_app_root(tmp_cwd)
tmp_complie_helper = compile_config.get_curr_config()
compile_config.set_app_win32_res(tmp_complie_helper.get_value('WIN32_RES'))
compile_config.set_curr_config(None)
import awtk_config as awtk
os.chdir(tmp_cwd)

View File

@ -11,6 +11,9 @@ COMPILE_CONFIG = None
global APP_ROOT
APP_ROOT = ''
global WIN32_RES
WIN32_RES = ''
def get_curr_config() :
global COMPILE_CONFIG
return COMPILE_CONFIG
@ -19,6 +22,10 @@ def set_curr_config(complie_config) :
global COMPILE_CONFIG
COMPILE_CONFIG = complie_config
def set_app_win32_res(dir_path) :
global WIN32_RES
WIN32_RES = dir_path
def set_curr_app_root(app_root) :
global APP_ROOT
APP_ROOT = app_root
@ -28,12 +35,14 @@ def get_curr_app_root() :
return APP_ROOT
def get_curr_config_for_awtk() :
global WIN32_RES
global COMPILE_CONFIG
if COMPILE_CONFIG != None :
return COMPILE_CONFIG
else :
COMPILE_CONFIG = complie_helper()
COMPILE_CONFIG.try_load_default_config()
COMPILE_CONFIG.set_value('WIN32_RES', WIN32_RES)
return COMPILE_CONFIG;
class complie_helper :
@ -60,6 +69,7 @@ class complie_helper :
'BUILD_TESTS' : { 'value' : True, 'desc' : ['build awtk\'s gtest demo'], 'help_info' : 'build awtk\'s gtest demo, value is true or false, default value is true' },
'BUILD_DEMOS' : { 'value' : True, 'desc' : ['build awtk\'s demo examples'], 'help_info' : 'build awtk\'s demo examples, value is true or false, default value is true' },
'BUILD_TOOLS' : { 'value' : True, 'desc' : ['build awtk\'s tools'], 'help_info' : 'build awtk\'s tools, value is true or false, default value is true' },
'WIN32_RES' : { 'value' : '', 'save_file' : False, 'desc' : ['app\'s win32 res path'], 'help_info' : 'app\'s win32 res path, WIN32_RES=XXXXX, value\'s default=\'awtk/win32_res/awtk.res\' ' },
}
def try_load_default_config(self) :