本文整理汇总了Python中TaskGen.declare_order方法的典型用法代码示例。如果您正苦于以下问题:Python TaskGen.declare_order方法的具体用法?Python TaskGen.declare_order怎么用?Python TaskGen.declare_order使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TaskGen
的用法示例。
在下文中一共展示了TaskGen.declare_order方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_order [as 别名]
try:
obj_ext = self.obj_ext
except AttributeError:
obj_ext = "_%d.o" % self.idx
task.defines = self.scanner_defines
task.inputs = [node]
task.outputs = [node.change_ext(obj_ext)]
self.compiled_tasks.append(task)
return task
cc_str = "${CC} ${CCFLAGS} ${CPPFLAGS} ${_CCINCFLAGS} ${_CCDEFFLAGS} ${CC_SRC_F}${SRC} ${CC_TGT_F}${TGT}"
link_str = "${LINK_CC} ${CCLNK_SRC_F}${SRC} ${CCLNK_TGT_F}${TGT} ${LINKFLAGS} ${_LIBDIRFLAGS} ${_LIBFLAGS}"
vnum_link_str = "${LINK_CC} ${CCLNK_SRC_F}${SRC} ${CCLNK_TGT_F}${TGT[1].bldpath(env)} ${LINKFLAGS} ${_LIBDIRFLAGS} ${_LIBFLAGS} && ln -sf ${TGT[1].name} ${TGT[0].bldpath(env)}"
cls = Task.simple_task_type("cc", cc_str, "GREEN", ext_out=".o", ext_in=".c")
cls.scan = ccroot.scan
cls.vars.append("CCDEPS")
cls = Task.simple_task_type("cc_link", link_str, color="YELLOW", ext_in=".o")
cls.maxjobs = 1
cls = Task.simple_task_type("vnum_cc_link", vnum_link_str, color="YELLOW", ext_in=".o")
cls.maxjobs = 1
TaskGen.declare_order(
"apply_incpaths", "apply_defines_cc", "apply_core", "apply_lib_vars", "apply_obj_vars_cc", "apply_obj_vars"
)
示例2: c_hook
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_order [as 别名]
libs=self.to_list(self.uselib)
for l in libs:
val=self.env['CCDEFINES_'+l]
if val:milst+=val
self.env['DEFLINES']=["%s %s"%(x[0],Utils.trimquotes('='.join(x[1:])))for x in[y.split('=')for y in milst]]
y=self.env['CCDEFINES_ST']
self.env['_CCDEFFLAGS']=[y%x for x in milst]
def c_hook(self,node):
task=self.create_task('cc')
try:obj_ext=self.obj_ext
except AttributeError:obj_ext='_%d.o'%self.idx
task.defines=self.scanner_defines
task.inputs=[node]
task.outputs=[node.change_ext(obj_ext)]
self.compiled_tasks.append(task)
cc_str='${CC} ${CCFLAGS} ${CPPFLAGS} ${_CCINCFLAGS} ${_CCDEFFLAGS} ${CC_SRC_F}${SRC} ${CC_TGT_F}${TGT}'
link_str='${LINK_CC} ${CCLNK_SRC_F}${SRC} ${CCLNK_TGT_F}${TGT} ${LINKFLAGS} ${_LIBDIRFLAGS} ${_LIBFLAGS}'
cls=Task.simple_task_type('cc',cc_str,'GREEN',ext_out='.o',ext_in='.c')
cls.scan=ccroot.scan
cls.vars.append('CCDEPS')
cls=Task.simple_task_type('cc_link',link_str,color='YELLOW',ext_in='.o')
cls.maxjobs=1
TaskGen.declare_order('apply_incpaths','apply_defines_cc','apply_core','apply_lib_vars','apply_obj_vars_cc','apply_obj_vars')
feature('cc')(init_cc)
before('apply_type_vars')(init_cc)
after('default_cc')(init_cc)
feature('cc')(apply_obj_vars_cc)
feature('cc')(apply_defines_cc)
extension(EXT_CC)(c_hook)
示例3: init_f
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_order [as 别名]
#################################################### Task generators
# we reuse a lot of code from ccroot.py
FORTRAN = 'init_f default_cc apply_incpaths apply_defines_cc apply_type_vars apply_lib_vars add_extra_flags apply_obj_vars_cc'.split()
FPROGRAM = 'apply_verif vars_target_cprogram install_target_cstaticlib apply_objdeps apply_obj_vars '.split()
FSHLIB = 'apply_verif vars_target_cstaticlib install_target_cstaticlib install_target_cshlib apply_objdeps apply_obj_vars apply_vnum'.split()
FSTATICLIB = 'apply_verif vars_target_cstaticlib install_target_cstaticlib apply_objdeps apply_obj_vars '.split()
TaskGen.bind_feature('fortran', FORTRAN)
TaskGen.bind_feature('fprogram', FPROGRAM)
TaskGen.bind_feature('fshlib', FSHLIB)
TaskGen.bind_feature('fstaticlib', FSTATICLIB)
TaskGen.declare_order('init_f', 'apply_lib_vars')
TaskGen.declare_order('default_cc', 'apply_core')
@feature('fortran')
@before('apply_type_vars')
@after('default_cc')
def init_f(self):
# PATH flags:
# - CPPPATH: same as C, for pre-processed fortran files
# - FORTRANMODPATH: where to look for modules (.mod)
# - FORTRANMODOUTPATH: where to *put* modules (.mod)
self.p_flag_vars = ['FC', 'FCFLAGS', 'RPATH', 'LINKFLAGS',
'FORTRANMODPATH', 'CPPPATH', 'FORTRANMODOUTPATH', '_CCINCFLAGS']
self.p_type_vars = ['FCFLAGS', 'LINKFLAGS']
@feature('fortran')