本文整理汇总了Python中TaskGen.bind_feature方法的典型用法代码示例。如果您正苦于以下问题:Python TaskGen.bind_feature方法的具体用法?Python TaskGen.bind_feature怎么用?Python TaskGen.bind_feature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TaskGen
的用法示例。
在下文中一共展示了TaskGen.bind_feature方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: cc_taskgen
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import bind_feature [as 别名]
#! /usr/bin/env python
# encoding: utf-8
import sys
if sys.hexversion < 0x020400f0: from sets import Set as set
import TaskGen,Build,Utils,Task
from Logs import debug
import ccroot
from TaskGen import feature,before,extension,after
g_cc_flag_vars=['CCDEPS','FRAMEWORK','FRAMEWORKPATH','STATICLIB','LIB','LIBPATH','LINKFLAGS','RPATH','CCFLAGS','CPPPATH','CPPFLAGS','CCDEFINES']
EXT_CC=['.c']
TaskGen.bind_feature('cc',['apply_core'])
g_cc_type_vars=['CCFLAGS','LINKFLAGS']
class cc_taskgen(ccroot.ccroot_abstract):
pass
def init_cc(self):
self.p_flag_vars=set(self.p_flag_vars).union(g_cc_flag_vars)
self.p_type_vars=set(self.p_type_vars).union(g_cc_type_vars)
if not self.env['CC_NAME']:
raise Utils.WafError("At least one compiler (gcc, ..) must be selected")
def apply_obj_vars_cc(self):
env=self.env
app=env.append_unique
cpppath_st=env['CPPPATH_ST']
for i in env['INC_PATHS']:
app('_CCINCFLAGS',cpppath_st%i.bldpath(env))
app('_CCINCFLAGS',cpppath_st%i.srcpath(env))
for i in env['CPPPATH']:
app('_CCINCFLAGS',cpppath_st%i)
app('_CCINCFLAGS',cpppath_st%'.')
app('_CCINCFLAGS',cpppath_st%env.variant())
tmpnode=self.path
示例2: init_d
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import bind_feature [as 别名]
@feature('d')
@before('apply_type_vars')
def init_d(self):
for x in d_params:
setattr(self, x, getattr(self, x, d_params[x]))
class d_taskgen(TaskGen.task_gen):
def __init__(self, *k, **kw):
TaskGen.task_gen.__init__(self, *k, **kw)
# COMPAT
if len(k) > 1:
self.features.append('d' + k[1])
# okay, we borrow a few methods from ccroot
TaskGen.bind_feature('d', D_METHS)
@feature('d')
@before('apply_d_libs')
def init_d(self):
Utils.def_attrs(self,
dflags='',
importpaths='',
libs='',
libpaths='',
uselib='',
uselib_local='',
generate_headers=False, # set to true if you want .di files as well as .o
compiled_tasks=[],
add_objects=[],
link_task=None)
示例3: cc_taskgen
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import bind_feature [as 别名]
"FRAMEWORK",
"FRAMEWORKPATH",
"STATICLIB",
"LIB",
"LIBPATH",
"LINKFLAGS",
"RPATH",
"CCFLAGS",
"CPPPATH",
"CPPFLAGS",
"CCDEFINES",
]
EXT_CC = [".c"]
TaskGen.bind_feature("cc", ["apply_core"])
g_cc_type_vars = ["CCFLAGS", "LINKFLAGS"]
class cc_taskgen(ccroot.ccroot_abstract):
pass
@feature("cc")
@before("apply_type_vars")
@after("default_cc")
def init_cc(self):
self.p_flag_vars = set(self.p_flag_vars).union(g_cc_flag_vars)
self.p_type_vars = set(self.p_type_vars).union(g_cc_type_vars)
示例4: init_d
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import bind_feature [as 别名]
def init_d(self):
for x in d_params:
setattr(self, x, getattr(self, x, d_params[x]))
class d_taskgen(TaskGen.task_gen):
def __init__(self, *k, **kw):
TaskGen.task_gen.__init__(self, *k, **kw)
# COMPAT
if len(k) > 1:
self.features.append("d" + k[1])
# okay, we borrow a few methods from ccroot
TaskGen.bind_feature("d", D_METHS)
@feature("d")
@before("apply_d_libs")
def init_d(self):
Utils.def_attrs(
self,
dflags="",
importpaths="",
libs="",
libpaths="",
uselib="",
uselib_local="",
generate_headers=False, # set to true if you want .di files as well as .o
compiled_tasks=[],
示例5: init_f
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import bind_feature [as 别名]
task = self.create_task('fortranpp')
task.inputs = [node]
task.outputs = [node.change_ext(obj_ext)]
self.compiled_tasks.append(task)
return task
#################################################### 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)
示例6: return
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import bind_feature [as 别名]
if not nd: nd = x.find_resource(name+'.ml')
if nd:
found_lst.append(nd)
break
else:
raw_lst.append(name)
return (found_lst, raw_lst)
native_lst=['native', 'all', 'c_object']
bytecode_lst=['bytecode', 'all']
class ocaml_taskgen(TaskGen.task_gen):
def __init__(self, *k, **kw):
TaskGen.task_gen.__init__(self, *k, **kw)
TaskGen.bind_feature('ocaml', 'apply_core')
@taskgen
@feature('ocaml')
def init_ml(self):
Utils.def_attrs(self,
type = 'all',
incpaths_lst = [],
bld_incpaths_lst = [],
mlltasks = [],
mlytasks = [],
mlitasks = [],
native_tasks = [],
bytecode_tasks = [],
linktasks = [],
bytecode_env = None,
示例7: pypp_taskgen
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import bind_feature [as 别名]
else:
if curBlock.strip() != '':
codeBlocks.append(curBlock)
curBlock = line + '\n'
if newIndent < baseIndent:
baseIndent = newIndent
if curBlock.strip() != '':
codeBlocks.append(curBlock)
return codeBlocks
CXX_METHS = ['extract_headers', 'init_cxx', 'apply_type_vars', 'apply_incpaths', 'apply_defines_cxx',
'apply_core', 'apply_lib_vars', 'apply_obj_vars_cxx', 'process_headers']
TaskGen.bind_feature('pypp', CXX_METHS)
createdLibraries = None
class pypp_taskgen(cxx.cxx_taskgen):
""" Class for dealing with header files and generate python wrappers using py++
This class behaves exactly like cppobj, compiling c/c++ files into objects, libraries,
or executables. In addition, it generates a wrapper with the specified header files using
py++ and calls it <name>.generated.cpp and compiles it.
Parameters:
start_decls specifies the declarations (classes) where to start parsing
include a list of all declaration files to be included as already_exposed
define_symobls a set of symbols that have to be defined for the GCCXML run
custom_code custom py++ to be executed before generating a module