优化编译脚本
This commit is contained in:
@@ -125,9 +125,9 @@ def def_slot_fun_str(slot_fun:str,pars:list):
|
||||
pars_names=get_pars_names(pars)
|
||||
for index,item in enumerate(pars_names):
|
||||
if(index<len(pars)-1):
|
||||
pars_str+=f"a->{item},"
|
||||
pars_str+=f"self->{item},"
|
||||
else:
|
||||
pars_str+=f"a->{item}"
|
||||
pars_str+=f"self->{item}"
|
||||
unsued_pars=""
|
||||
for item in pars_names:
|
||||
unsued_pars+=f" (void){item};\n"
|
||||
@@ -136,7 +136,7 @@ __attribute__((weak)) void {slot_fun}({','.join(pars)}){'{'}
|
||||
{unsued_pars}{'}'}
|
||||
|
||||
static void {slot_fun}_caller(void *args){'{'}
|
||||
{slot_fun}_args *a = args;
|
||||
{slot_fun}_args *self = args;
|
||||
{slot_fun}({pars_str});
|
||||
{'}'}
|
||||
"""
|
||||
@@ -263,6 +263,7 @@ def moc_file_create(out_file_path,scan_path_list):
|
||||
# 不需要重新生成
|
||||
if(not check_rebuild(out_file_path,list_file)):
|
||||
return
|
||||
print(f"生成 {out_file_path}")
|
||||
with open(out_file_path,"w+") as f:
|
||||
f.write("#include \"stdlib.h\"\n")
|
||||
f.write("#include \"string.h\"\n")
|
||||
|
||||
Reference in New Issue
Block a user