本文整理汇总了Python中TaskGen.declare_chain方法的典型用法代码示例。如果您正苦于以下问题:Python TaskGen.declare_chain方法的具体用法?Python TaskGen.declare_chain怎么用?Python TaskGen.declare_chain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TaskGen
的用法示例。
在下文中一共展示了TaskGen.declare_chain方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: decide_ext
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#!/usr/bin/env python
# encoding: utf-8
# John O'Meara, 2006
# Thomas Nagy, 2006-2008
"Flex processing"
import TaskGen
def decide_ext(self, node):
if 'cxx' in self.features: return '.lex.cc'
else: return '.lex.c'
TaskGen.declare_chain(
name = 'flex',
rule = '${FLEX} -o${TGT} ${FLEXFLAGS} ${SRC}',
ext_in = '.l',
ext_out = '.c .cxx',
decider = decide_ext,
)
def detect(conf):
conf.find_program('flex', var='FLEX', mandatory=True)
conf.env['FLEXFLAGS'] = ''
示例2: init_lua
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#! /usr/bin/env python
# encoding: utf-8
import TaskGen
from TaskGen import taskgen,feature
from Constants import*
TaskGen.declare_chain(name='luac',rule='${LUAC} -s -o ${TGT} ${SRC}',ext_in='.lua',ext_out='.luac',reentrant=0,install='LUADIR',)
def init_lua(self):
self.default_chmod=O755
def detect(conf):
conf.find_program('luac',var='LUAC',mandatory=True)
feature('lua')(init_lua)
示例3: edje
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
def edje(self):
self.default_chmod=0664
bld_rule = '${EDJE} '+'-id '+self.cwd+' -fd '+self.cwd+' ${SRC} ${TGT}'
TaskGen.declare_chain(name='edje_cc', rule=bld_rule, ext_in='.edc', ext_out='.edj', reentrant=0, install=None)
示例4: detect
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#!/usr/bin/env python
# encoding: utf-8
# Ali Sabil, 2007
import TaskGen
TaskGen.declare_chain(
name = 'gob2',
rule = '${GOB2} -o ${TGT[0].bld_dir(env)} ${GOB2FLAGS} ${SRC}',
ext_in = '.gob',
ext_out = '.c'
)
def detect(conf):
gob2 = conf.find_program('gob2', var='GOB2', mandatory=True)
conf.env['GOB2'] = gob2
conf.env['GOB2FLAGS'] = ''
示例5: default_cython
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
if copy:
copy.close()
try:
os.remove(src_file)
except OSError:
pass
except IOError:
pass
else:
os.rename(copy_file, src_file)
return 0
f = TaskGen.declare_chain(
name = 'cythonc',
action = cython_run,
ext_in = '.pyx',
ext_out = '.c',
reentrant = True,
after='apply_cython_extra',
scan=scan_deps)
@TaskGen.feature('cython')
@TaskGen.before('apply_core')
def default_cython(self):
Utils.def_attrs(self,
cython_includes = '',
no_timestamp = False)
@TaskGen.feature('cython')
@TaskGen.after('apply_core')
def apply_cython_incpaths(self):
"""Used to build _CYTHONINCFLAGS, and the dependencies scanner (when ready).
示例6: cscan
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
def cscan(self):
txt = self.inputs[0].read(self.env)
mods = []
for m in re_cyt.finditer(txt):
mods.append(m.group(1))
incs = getattr(self.generator, 'cython_includes', [])
incs = [self.generator.path.find_dir(x) for x in incs]
incs.append(self.inputs[0].parent)
found = []
missing = []
for x in mods:
for y in incs:
k = y.find_resource(x + '.pxd')
if k:
found.append(k)
break
else:
missing.append(x)
return (found, missing)
TaskGen.declare_chain(name='cython', rule='${CYTHON} ${CYTHONFLAGS} ${SRC} -o ${TGT}', ext_in=['.pyx'], ext_out=['.c'], scan=cscan)
def detect(conf):
conf.find_program('cython', var='CYTHON', mandatory=True)
示例7: detect
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006 (ita)
"Demo: '.coin' files are converted into cpp files using 'cat': {.coin -> .cpp -> .o}"
import TaskGen
TaskGen.declare_chain(
name = 'copy',
action = '${COPY} ${SRC} ${TGT}',
ext_in = '.coin',
ext_out = '.cpp',
reentrant = False
)
def detect(conf):
#dang = conf.find_program('cat', var='DANG')
#if not dang: conf.fatal('cannot find the program "cat"')
import os
conf.env['COPY'] = os.getcwd() + os.sep + "cp.py"
示例8: decide_ext
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#! /usr/bin/env python
# encoding: utf-8
import TaskGen
def decide_ext(self,node):
if'cxx'in self.features:return'.lex.cc'
else:return'.lex.c'
TaskGen.declare_chain(name='flex',action='${FLEX} -o${TGT} ${FLEXFLAGS} ${SRC}',ext_in='.l',decider=decide_ext,before='cc cxx',)
def detect(conf):
flex=conf.find_program('flex',var='FLEX')
if not flex:conf.fatal("flex was not found")
v=conf.env
v['FLEXFLAGS']=''
示例9: Copyright
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
# encoding: utf-8
# inkscape-convert - Convert svg files to pdf
# Copyright (C) 2009 Michael Budde
import TaskGen
TaskGen.declare_chain(
name='inkscape-svg-convert',
action='${INKSCAPE} ${INKSCAPEFLAGS} --export-pdf=${TGT} ${SRC}',
ext_in='.svg',
ext_out='.pdf',
reentrant=False)
def detect(conf):
conf.find_program('inkscape', var='INKSCAPE', mandatory=True)
conf.env['INKSCAPEFLAGS'] = ''
示例10: detect
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006 (ita)
"Demo: '.coin' files are converted into cpp files using 'cat': {.coin -> .cpp -> .o}"
import TaskGen
TaskGen.declare_chain(
name = 'dang',
action = '${DANG} ${SRC} > ${TGT}',
ext_in = '.coin',
ext_out = '.cpp',
before = 'cxx cc',
)
def detect(conf):
dang = conf.find_program('cat', var='DANG', mandatory=True)
示例11: decide_ext
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#!/usr/bin/env python
# encoding: utf-8
# John O'Meara, 2006
"Bison processing"
import TaskGen
def decide_ext(self, node):
c_ext = '.tab.c'
if node.name.endswith('.yc'): c_ext = '.tab.cc'
if '-d' in self.env['BISONFLAGS']:
return [c_ext, c_ext.replace('c', 'h')]
else:
return c_ext
TaskGen.declare_chain(
name = 'bison',
rule = 'cd ${SRC[0].bld_dir(env)} && ${BISON} ${BISONFLAGS} ${SRC[0].abspath()} -o ${TGT[0].name}',
ext_in = '.y .yc .yy',
decider = decide_ext,
before = 'cc cxx',
)
def detect(conf):
bison = conf.find_program('bison', var='BISON', mandatory=True)
v = conf.env
v['BISONFLAGS'] = '-d'
示例12: init_lua
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#!/usr/bin/env python
# encoding: utf-8
# Sebastian Schlingmann, 2008
# Thomas Nagy, 2008 (ita)
import TaskGen
from TaskGen import taskgen, feature
from Constants import *
TaskGen.declare_chain(
name="luac",
rule="${LUAC} -s -o ${TGT} ${SRC}",
ext_in=".lua",
ext_out=".luac",
reentrant=0,
install="LUADIR", # env variable
)
@taskgen
@feature("lua")
def init_lua(self):
self.default_chmod = O755
def detect(conf):
conf.find_program("luac", var="LUAC", mandatory=True)
示例13: decide_ext
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
# encoding: utf-8
import TaskGen
def decide_ext(self, node):
c_ext = ".tab.c"
if node.name.endswith(".yc"):
c_ext = ".tab.cc"
if "-d" in self.env["BISONFLAGS"]:
return [c_ext, c_ext.replace("c", "h")]
else:
return c_ext
TaskGen.declare_chain(
name="bison",
action="cd ${SRC[0].bld_dir(env)} && ${BISON} ${BISONFLAGS} ${SRC[0].abspath()} -o ${TGT[0].name}",
ext_in=".y .yc .yy",
decider=decide_ext,
before="cc cxx",
)
def detect(conf):
bison = conf.find_program("bison", var="BISON")
if not bison:
conf.fatal("bison was not found")
v = conf.env
v["BISONFLAGS"] = "-d"
示例14: configure
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
import Task
import TaskGen
from TaskGen import extension
import sys
TaskGen.declare_chain(
name='genpy',
rule='${PYTHON} ${SRC} > ${TGT}',
reentrant=True,
color='BLUE',
ext_in='.genpy',
ext_out='.c',
before='c')
def configure(conf):
conf.env['PYTHON'] = sys.executable
conf.env['GENPY_EXT'] = ['.genpy']
return True
示例15: init_lua
# 需要导入模块: import TaskGen [as 别名]
# 或者: from TaskGen import declare_chain [as 别名]
#! /usr/bin/env python
# encoding: utf-8
import TaskGen
from TaskGen import taskgen, feature
from Constants import *
TaskGen.declare_chain(
name="luac", rule="${LUAC} -s -o ${TGT} ${SRC}", ext_in=".lua", ext_out=".luac", reentrant=False, install="LUADIR"
)
def init_lua(self):
self.default_chmod = O755
def detect(conf):
conf.find_program("luac", var="LUAC", mandatory=True)
feature("lua")(init_lua)