在Waf中,我如何创建多个可以并行运行的自定义任务(使用–jobs = JOBS)?
Sources = [“C:\ src1.c”,“C:\ Mod1 \ src2.c”,… 30pcs]每次通话#1Incl_Paths = [“Mod1”。 “Mod1”] #list …
像这样的东西应该适用于waf 1.7:
from waflib.Task import Task from waflib.TaskGen import extension Ext_out = "_loc" # output file extension def configure(conf): # loc.exe must be in the system path for this to work conf.find_program( 'loc', var = "LOC", ) conf.env.Incl_Paths = ["Mod1", "Mod1"] conf.env.INCL_ST = "-I%s" @extension('.c') def process_loc(self, node): out_node = node.change_ext(Ext_out) tsk = self.create_task('loc') tsk.set_inputs(node) tsk.set_outputs(out_node) class loc_task(Task): ext_in = ['.c'] ext_out = ['_loc'] run_str = "${LOC} ${INCL_ST:Incl_Paths} ${SRC} > ${TGT}" def build(bld): bld(source = ["src1.c", "src2.c"])
那么它适用于我在linux faking loc ...