当前位置: 首页>>代码示例>>Python>>正文


Python TaskGen.extension方法代码示例

本文整理汇总了Python中waflib.TaskGen.extension方法的典型用法代码示例。如果您正苦于以下问题:Python TaskGen.extension方法的具体用法?Python TaskGen.extension怎么用?Python TaskGen.extension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在waflib.TaskGen的用法示例。


在下文中一共展示了TaskGen.extension方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: enable_support

# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import extension [as 别名]
def enable_support(cc, cxx):
    if cxx or not cc:
        make_cxx_batch = TaskGen.extension(".cpp", ".cc", ".cxx", ".C", ".c++")(make_batch_fun("cxx"))
    if cc:
        make_c_batch = TaskGen.extension(".c")(make_batch_fun("c"))
    else:
        TaskGen.task_gen.mappings[".c"] = TaskGen.task_gen.mappings[".cpp"]
开发者ID:maksqwe,项目名称:jack2,代码行数:9,代码来源:unity.py

示例2: enable_support

# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import extension [as 别名]
def enable_support(cc, cxx):
	if cxx or not cc:
		TaskGen.extension('.cpp', '.cc', '.cxx', '.C', '.c++')(make_batch_fun('cxx'))
	if cc:
		TaskGen.extension('.c')(make_batch_fun('c'))
	else:
		TaskGen.task_gen.mappings['.c'] = TaskGen.task_gen.mappings['.cpp']
开发者ID:BillTian,项目名称:waf,代码行数:9,代码来源:unity.py

示例3: c_hook

# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import extension [as 别名]
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/svn/docs/wafbook/single.html#_obtaining_the_waf_file

from waflib import TaskGen,Task,Utils
from waflib.Tools import c_preproc
from waflib.Tools.ccroot import link_task,stlink_task
def c_hook(self,node):
	return self.create_compiled_task('c',node)
class c(Task.Task):
	run_str='${CC} ${ARCH_ST:ARCH} ${CFLAGS} ${CPPFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CC_SRC_F}${SRC} ${CC_TGT_F}${TGT}'
	vars=['CCDEPS']
	ext_in=['.h']
	scan=c_preproc.scan
Task.classes['cc']=cc=c
class cprogram(link_task):
	run_str='${LINK_CC} ${CCLNK_SRC_F}${SRC} ${CCLNK_TGT_F}${TGT[0].abspath()} ${RPATH_ST:RPATH} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${FRAMEWORK_ST:FRAMEWORK} ${ARCH_ST:ARCH} ${STLIB_MARKER} ${STLIBPATH_ST:STLIBPATH} ${STLIB_ST:STLIB} ${SHLIB_MARKER} ${LIBPATH_ST:LIBPATH} ${LIB_ST:LIB} ${LINKFLAGS}'
	ext_out=['.bin']
	vars=['LINKDEPS']
	inst_to='${BINDIR}'
	chmod=Utils.O755
class cshlib(cprogram):
	inst_to='${LIBDIR}'
class cstlib(stlink_task):
	pass

TaskGen.extension('.c')(c_hook)
开发者ID:HariKishan8,项目名称:Networks,代码行数:29,代码来源:c.py

示例4: cxx_hook

# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import extension [as 别名]
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2010 (ita)

"Base for c++ programs and libraries"

from waflib import TaskGen, Task, Utils
from waflib.Tools import c_preproc
from waflib.Tools.ccroot import link_task, stlink_task

def cxx_hook(self, node):
	"Bind the c++ file extensions to the creation of a :py:class:`waflib.Tools.cxx.cxx` instance"
	return self.create_compiled_task('cxx', node)
TaskGen.extension('.cpp','.cc','.cxx','.C','.c++')(cxx_hook) # leave like this for python 2.3

if not '.c' in TaskGen.task_gen.mappings:
	TaskGen.task_gen.mappings['.c'] = TaskGen.task_gen.mappings['.cpp']

class cxx(Task.Task):
	"Compile C++ files into object files"
	run_str = '${CXX} ${ARCH_ST:ARCH} ${CXXFLAGS} ${CPPFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CXX_SRC_F} ${SRC} ${CXX_TGT_F} ${TGT}'
	vars    = ['CXXDEPS'] # unused variable to depend on, just in case
	ext_in  = ['.h'] # set the build order easily by using ext_out=['.h']
	scan    = c_preproc.scan
	shell   = True

class cxxprogram(link_task):
	"Link object files into a c++ program"
	run_str = '${LINK_CXX} ${LINKFLAGS} ${CXXLNK_SRC_F} ${SRC} ${CXXLNK_TGT_F} ${TGT[0].abspath()} ${RPATH_ST:RPATH} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${FRAMEWORK_ST:FRAMEWORK} ${ARCH_ST:ARCH} ${STLIB_MARKER} ${STLIBPATH_ST:STLIBPATH} ${STLIB_ST:STLIB} ${SHLIB_MARKER} ${LIBPATH_ST:LIBPATH} ${LIB_ST:LIB} ${FINAL_LINK_VAR}'
	vars    = ['LINKDEPS']
	ext_out = ['.bin']
开发者ID:GrahamDennis,项目名称:xpdeint,代码行数:33,代码来源:cxx.py

示例5: fix_fun_doc

# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import extension [as 别名]
			if not fun_name in task_gen.prec[func.__name__]:
				task_gen.prec[func.__name__].append(fun_name)
		fix_fun_doc(func)
		append_doc(func, 'after', k)
		return func
	return deco
after.__doc__ = TaskGen.after.__doc__
TaskGen.after = after

# replay existing methods
TaskGen.taskgen_method(TaskGen.to_nodes)
TaskGen.feature('*')(TaskGen.process_source)
TaskGen.feature('*')(TaskGen.process_rule)
TaskGen.before('process_source')(TaskGen.process_rule)
TaskGen.feature('seq')(TaskGen.sequence_order)
TaskGen.extension('.pc.in')(TaskGen.add_pcfile)
TaskGen.feature('subst')(TaskGen.process_subst)
TaskGen.before('process_source','process_rule')(TaskGen.process_subst)

from waflib.Task import Task

Task.__dict__['post_run'].__doc__ = "Update the cache files (executed by threads). Override in subclasses."


from waflib import Configure, Build, Errors
confmeths = []
def conf(f):
	def fun(*k, **kw):
		mandatory = True
		if 'mandatory' in kw:
			mandatory = kw['mandatory']
开发者ID:kenmasumitsu,项目名称:waf,代码行数:33,代码来源:conf.py

示例6: bld

# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import extension [as 别名]
       for dep in module_deps:
           try:
               tsk = bld.get_tgen_by_name(dep)
               for cp in tsk.classpath:
                   real_classpath.append(cp)
           except:
               return

       #build the jar
       jar = bld(features='javac jar add_targets install_tgt', manifest=manifest, jarcreate=jarcreate, srcdir=sourcedir, classpath=real_classpath, targets_to_add=targets_to_add + cp_targets, 
               use=module_deps, name=targetName, target=targetName, basedir='classes', outdir='classes', destfile=libName, compat=compat, dir=bld.path.get_bld(), files=[libName])

       jar.install_path = installPath or '${PREFIX}/lib'


       if have_native_sourcedir:
           lib = bld(features='%s %sshlib' % (nlang, nlang), includes='%s/include' % native_sourcedir,
                                  target='%s.jni-%s' % (modArgs['name'], nlang), env=env.derive(),
                                  uselib=uselib, use=uselib_local,
                           source=bld.path.find_dir(native_sourcedir).ant_glob('source/*%s' % nsourceExt))

           jar.targets_to_add.append(lib)

           lib.install_path = installPath or '${PREFIX}/lib'

       return jar

# Tell waf to ignore any build.xml files, the 'ant' feature will take care of them.
TaskGen.extension('build.xml')(Utils.nada)

开发者ID:adam-beauchamp,项目名称:coda-oss,代码行数:31,代码来源:javatool.py

示例7: cxx_hook

# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import extension [as 别名]
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/svn/docs/wafbook/single.html#_obtaining_the_waf_file

from waflib import TaskGen,Task,Utils
from waflib.Tools import c_preproc
from waflib.Tools.ccroot import link_task,stlink_task
def cxx_hook(self,node):
	return self.create_compiled_task('cxx',node)
TaskGen.extension('.cpp','.cc','.cxx','.C','.c++')(cxx_hook)
if not'.c'in TaskGen.task_gen.mappings:
	TaskGen.task_gen.mappings['.c']=TaskGen.task_gen.mappings['.cpp']
class cxx(Task.Task):
	run_str='${CXX} ${ARCH_ST:ARCH} ${CXXFLAGS} ${CPPFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CXX_SRC_F}${SRC} ${CXX_TGT_F}${TGT}'
	vars=['CXXDEPS']
	ext_in=['.h']
	scan=c_preproc.scan
class cxxprogram(link_task):
	run_str='${LINK_CXX} ${CXXLNK_SRC_F}${SRC} ${CXXLNK_TGT_F}${TGT[0].abspath()} ${RPATH_ST:RPATH} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${FRAMEWORK_ST:FRAMEWORK} ${ARCH_ST:ARCH} ${STLIB_MARKER} ${STLIBPATH_ST:STLIBPATH} ${STLIB_ST:STLIB} ${SHLIB_MARKER} ${LIBPATH_ST:LIBPATH} ${LIB_ST:LIB} ${LINKFLAGS}'
	vars=['LINKDEPS']
	ext_out=['.bin']
	inst_to='${BINDIR}'
	chmod=Utils.O755
class cxxshlib(cxxprogram):
	inst_to='${LIBDIR}'
class cxxstlib(stlink_task):
	pass
开发者ID:HariKishan8,项目名称:Networks,代码行数:29,代码来源:cxx.py

示例8: print

# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import extension [as 别名]
        test.sys = sysname
        test.ram = sdramname or sramname or ""
        test.rom = romname
        test.atstr = atstr
        test.filename = filename
        test.ut_exec = exec_list + param
        print(' '.join(test.ut_exec))

from waflib.TaskGen import feature, after_method, before_method, task_gen
feature('systest')(make_systest)
after_method('apply_link')(make_systest)

# ASM hooks for the gcc compiler
def s_hook(self,node):
	return self.create_compiled_task('c',node)
TaskGen.extension('.S')(s_hook)


MKPROM = Task.task_factory( 'MKPROM',
    func  = '${MKPROM} ${_MKPROMFLAGS} -o ${TGT} ${SRC}',
    color = 'YELLOW')

MKPROM_TSKS = list()

def make_prom(self):
    """Create mkprom task"""
    elf = self.target
    if hasattr(self, 'promflags'):
        promflags = Utils.to_list(self.promflags)
    if hasattr(self, 'prom'):
        promname = self.prom
开发者ID:Emantor,项目名称:core,代码行数:33,代码来源:systools.py

示例9: append_doc

# 需要导入模块: from waflib import TaskGen [as 别名]
# 或者: from waflib.TaskGen import extension [as 别名]
        append_doc(func, "after", k)
        return func

    return deco


after.__doc__ = TaskGen.after.__doc__
TaskGen.after = after

# replay existing methods
TaskGen.taskgen_method(TaskGen.to_nodes)
TaskGen.feature("*")(TaskGen.process_source)
TaskGen.feature("*")(TaskGen.process_rule)
TaskGen.before("process_source")(TaskGen.process_rule)
TaskGen.feature("seq")(TaskGen.sequence_order)
TaskGen.extension(".pc.in")(TaskGen.add_pcfile)
TaskGen.feature("subst")(TaskGen.process_subst)
TaskGen.before("process_source", "process_rule")(TaskGen.process_subst)

from waflib.Task import Task

Task.__dict__["post_run"].__doc__ = "Update the cache files (executed by threads). Override in subclasses."


from waflib import Configure, Build

confmeths = []


def conf(f):
    def fun(*k, **kw):
开发者ID:yotann,项目名称:waf,代码行数:33,代码来源:conf.py


注:本文中的waflib.TaskGen.extension方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。