d¶
- waflib.Tools.d.taskgen_method(func)¶
Decorator that registers method as a task generator method. The function must accept a task generator as first parameter:
from waflib.TaskGen import taskgen_method @taskgen_method def mymethod(self): pass
- Parameters:
func (function) – task generator method to add
- Return type:
function
- waflib.Tools.d.feature(*k)¶
Decorator that registers a task generator method that will be executed when the object attribute
feature
contains the corresponding key(s):from waflib.TaskGen import feature @feature('myfeature') def myfunction(self): print('that is my feature!') def build(bld): bld(features='myfeature')
- Parameters:
k (list of string) – feature names
- waflib.Tools.d.extension(*k)¶
Decorator that registers a task generator method which will be invoked during the processing of source files for the extension given:
from waflib import Task class mytask(Task): run_str = 'cp ${SRC} ${TGT}' @extension('.moo') def create_maa_file(self, node): self.create_task('mytask', node, node.change_ext('.maa')) def build(bld): bld(source='foo.moo')
- class waflib.Tools.d.link_task(*k, **kw)[source]¶
Base class for all link tasks. A task generator is supposed to have at most one link task bound in the attribute link_task. See
waflib.Tools.ccroot.apply_link()
.- color = 'YELLOW'¶
Color for the console display, see
waflib.Logs.colors_lst
- weight = 3¶
Try to process link tasks as early as possible
- inst_to = None¶
Default installation path for the link task outputs, or None to disable
- chmod = 493¶
Default installation mode for the link task outputs
- add_target(target)[source]¶
Process the target attribute to add the platform-specific prefix/suffix such as .so or .exe. The settings are retrieved from
env.clsname_PATTERN
- exec_command(*k, **kw)[source]¶
Wrapper for
waflib.Context.Context.exec_command()
. This version set the current working directory (build.variant_dir
), applies PATH settings (if self.env.PATH is provided), and can run long commands through a temporary@argfile
.- Parameters:
cmd (list of string (best) or string (process will use a shell)) – process command to execute
- Returns:
the return code
- Return type:
int
Optional parameters:
cwd: current working directory (Node or string)
stdout: set to None to prevent waf from capturing the process standard output
stderr: set to None to prevent waf from capturing the process standard error
timeout: timeout value (Python 3)
- hasrun¶
- generator¶
- env¶
waflib.ConfigSet.ConfigSet
object (make sure to provide one)
- inputs¶
List of input nodes, which represent the files used by the task instance
- outputs¶
List of output nodes, which represent the files created by the task instance
- dep_nodes¶
List of additional nodes to depend on
- run_after¶
Set of tasks that must be executed before this one
- __annotations__ = {}¶
- __dict__ = mappingproxy({'__module__': 'waflib.Tools.ccroot', '__firstlineno__': 130, '__doc__': '\nBase class for all link tasks. A task generator is supposed to have at most one link task bound in the attribute *link_task*. See :py:func:`waflib.Tools.ccroot.apply_link`.\n\n.. inheritance-diagram:: waflib.Tools.ccroot.stlink_task waflib.Tools.c.cprogram waflib.Tools.c.cshlib waflib.Tools.cxx.cxxstlib waflib.Tools.cxx.cxxprogram waflib.Tools.cxx.cxxshlib waflib.Tools.d.dprogram waflib.Tools.d.dshlib waflib.Tools.d.dstlib waflib.Tools.ccroot.fake_shlib waflib.Tools.ccroot.fake_stlib waflib.Tools.asm.asmprogram waflib.Tools.asm.asmshlib waflib.Tools.asm.asmstlib\n :top-classes: waflib.Tools.ccroot.link_task\n', 'color': 'YELLOW', 'weight': 3, 'inst_to': None, 'chmod': 493, 'add_target': <function link_task.add_target>, 'exec_command': <function link_task.exec_command>, 'exec_mf': <function link_task.exec_mf>, '__static_attributes__': (), '__dict__': <attribute '__dict__' of 'link_task' objects>, '__weakref__': <attribute '__weakref__' of 'link_task' objects>, '__annotations__': {}})¶
- __firstlineno__ = 130¶
- __static_attributes__ = ()¶
- class waflib.Tools.d.stlink_task(*k, **kw)[source]¶
Base for static link tasks, which use ar most of the time.
- run_str = None¶
- chmod = 420¶
Default installation mode for the static libraries
- hasrun¶
- generator¶
- env¶
waflib.ConfigSet.ConfigSet
object (make sure to provide one)
- inputs¶
List of input nodes, which represent the files used by the task instance
- outputs¶
List of output nodes, which represent the files created by the task instance
- dep_nodes¶
List of additional nodes to depend on
- run_after¶
Set of tasks that must be executed before this one
- __annotations__ = {}¶
- __firstlineno__ = 225¶
- __static_attributes__ = ()¶
- hcode = b"[b'\\t\\tlambda task: task.remove_before_build(),\\n', b'${AR} ${ARFLAGS} ${AR_TGT_F}${TGT} ${AR_SRC_F}${SRC}']"¶
String representing an additional hash for the class representation
- orig_run_str = [<function stlink_task.<lambda>>, '${AR} ${ARFLAGS} ${AR_TGT_F}${TGT} ${AR_SRC_F}${SRC}']¶
- vars = ['AR', 'ARFLAGS', 'AR_SRC_F', 'AR_TGT_F']¶
ConfigSet variables that should trigger a rebuild (class attribute used for
waflib.Task.Task.sig_vars()
)
- class waflib.Tools.d.d(*k, **kw)[source]¶
Compile a d file into an object file
- color = 'GREEN'¶
Color for the console display, see
waflib.Logs.colors_lst
- run_str = None¶
- scan()¶
look for .d/.di used by a d file
- hasrun¶
- generator¶
- env¶
waflib.ConfigSet.ConfigSet
object (make sure to provide one)
- inputs¶
List of input nodes, which represent the files used by the task instance
- outputs¶
List of output nodes, which represent the files created by the task instance
- dep_nodes¶
List of additional nodes to depend on
- run_after¶
Set of tasks that must be executed before this one
- __dict__ = mappingproxy({'__module__': 'waflib.Tools.d', '__firstlineno__': 11, '__doc__': 'Compile a d file into an object file', 'color': 'GREEN', 'run_str': None, 'scan': <function scan>, '__static_attributes__': (), '__dict__': <attribute '__dict__' of 'd' objects>, '__weakref__': <attribute '__weakref__' of 'd' objects>, 'hcode': b'${D} ${DFLAGS} ${DINC_ST:INCPATHS} ${D_SRC_F:SRC} ${D_TGT_F:TGT}', 'orig_run_str': '${D} ${DFLAGS} ${DINC_ST:INCPATHS} ${D_SRC_F:SRC} ${D_TGT_F:TGT}', 'run': <function f>, 'vars': ['D', 'DFLAGS', 'DINC_ST', 'D_SRC_F', 'D_TGT_F', 'INCPATHS'], '__annotations__': {}})¶
- __firstlineno__ = 11¶
- __static_attributes__ = ()¶
- hcode = b'${D} ${DFLAGS} ${DINC_ST:INCPATHS} ${D_SRC_F:SRC} ${D_TGT_F:TGT}'¶
String representing an additional hash for the class representation
- orig_run_str = '${D} ${DFLAGS} ${DINC_ST:INCPATHS} ${D_SRC_F:SRC} ${D_TGT_F:TGT}'¶
- vars = ['D', 'DFLAGS', 'DINC_ST', 'D_SRC_F', 'D_TGT_F', 'INCPATHS']¶
ConfigSet variables that should trigger a rebuild (class attribute used for
waflib.Task.Task.sig_vars()
)
- class waflib.Tools.d.d_with_header(*k, **kw)[source]¶
Compile a d file and generate a header
- run_str = None¶
- hasrun¶
- generator¶
- env¶
waflib.ConfigSet.ConfigSet
object (make sure to provide one)
- inputs¶
List of input nodes, which represent the files used by the task instance
- outputs¶
List of output nodes, which represent the files created by the task instance
- dep_nodes¶
List of additional nodes to depend on
- run_after¶
Set of tasks that must be executed before this one
- __firstlineno__ = 17¶
- __static_attributes__ = ()¶
- hcode = b'${D} ${DFLAGS} ${DINC_ST:INCPATHS} ${D_HDR_F:tgt.outputs[1].bldpath()} ${D_SRC_F:SRC} ${D_TGT_F:tgt.outputs[0].bldpath()}'¶
String representing an additional hash for the class representation
- orig_run_str = '${D} ${DFLAGS} ${DINC_ST:INCPATHS} ${D_HDR_F:tgt.outputs[1].bldpath()} ${D_SRC_F:SRC} ${D_TGT_F:tgt.outputs[0].bldpath()}'¶
- vars = ['D', 'DFLAGS', 'DINC_ST', 'D_HDR_F', 'D_SRC_F', 'D_TGT_F', 'INCPATHS', 'tgt.outputs[0].bldpath()', 'tgt.outputs[1].bldpath()']¶
ConfigSet variables that should trigger a rebuild (class attribute used for
waflib.Task.Task.sig_vars()
)
- class waflib.Tools.d.d_header(*k, **kw)[source]¶
Compile d headers
- color = 'BLUE'¶
Color for the console display, see
waflib.Logs.colors_lst
- run_str = None¶
- hasrun¶
- generator¶
- env¶
waflib.ConfigSet.ConfigSet
object (make sure to provide one)
- inputs¶
List of input nodes, which represent the files used by the task instance
- outputs¶
List of output nodes, which represent the files created by the task instance
- dep_nodes¶
List of additional nodes to depend on
- run_after¶
Set of tasks that must be executed before this one
- __dict__ = mappingproxy({'__module__': 'waflib.Tools.d', '__firstlineno__': 21, '__doc__': 'Compile d headers', 'color': 'BLUE', 'run_str': None, '__static_attributes__': (), '__dict__': <attribute '__dict__' of 'd_header' objects>, '__weakref__': <attribute '__weakref__' of 'd_header' objects>, 'hcode': b'${D} ${D_HEADER} ${SRC}', 'orig_run_str': '${D} ${D_HEADER} ${SRC}', 'run': <function f>, 'vars': ['D', 'D_HEADER'], '__annotations__': {}})¶
- __firstlineno__ = 21¶
- __static_attributes__ = ()¶
- hcode = b'${D} ${D_HEADER} ${SRC}'¶
String representing an additional hash for the class representation
- orig_run_str = '${D} ${D_HEADER} ${SRC}'¶
- vars = ['D', 'D_HEADER']¶
ConfigSet variables that should trigger a rebuild (class attribute used for
waflib.Task.Task.sig_vars()
)
- class waflib.Tools.d.dprogram(*k, **kw)[source]¶
Link object files into a d program
- run_str = None¶
- inst_to = '${BINDIR}'¶
Default installation path for the link task outputs, or None to disable
- hasrun¶
- generator¶
- env¶
waflib.ConfigSet.ConfigSet
object (make sure to provide one)
- inputs¶
List of input nodes, which represent the files used by the task instance
- outputs¶
List of output nodes, which represent the files created by the task instance
- dep_nodes¶
List of additional nodes to depend on
- run_after¶
Set of tasks that must be executed before this one
- __firstlineno__ = 26¶
- __static_attributes__ = ()¶
- hcode = b'${D_LINKER} ${LINKFLAGS} ${DLNK_SRC_F}${SRC} ${DLNK_TGT_F:TGT} ${RPATH_ST:RPATH} ${DSTLIB_MARKER} ${DSTLIBPATH_ST:STLIBPATH} ${DSTLIB_ST:STLIB} ${DSHLIB_MARKER} ${DLIBPATH_ST:LIBPATH} ${DSHLIB_ST:LIB}'¶
String representing an additional hash for the class representation
- orig_run_str = '${D_LINKER} ${LINKFLAGS} ${DLNK_SRC_F}${SRC} ${DLNK_TGT_F:TGT} ${RPATH_ST:RPATH} ${DSTLIB_MARKER} ${DSTLIBPATH_ST:STLIBPATH} ${DSTLIB_ST:STLIB} ${DSHLIB_MARKER} ${DLIBPATH_ST:LIBPATH} ${DSHLIB_ST:LIB}'¶
- vars = ['DLIBPATH_ST', 'DLNK_SRC_F', 'DLNK_TGT_F', 'DSHLIB_MARKER', 'DSHLIB_ST', 'DSTLIBPATH_ST', 'DSTLIB_MARKER', 'DSTLIB_ST', 'D_LINKER', 'LIB', 'LIBPATH', 'LINKFLAGS', 'RPATH', 'RPATH_ST', 'STLIB', 'STLIBPATH']¶
ConfigSet variables that should trigger a rebuild (class attribute used for
waflib.Task.Task.sig_vars()
)
- class waflib.Tools.d.dshlib(*k, **kw)[source]¶
Link object files into a d shared library
- inst_to = '${LIBDIR}'¶
Default installation path for the link task outputs, or None to disable
- hasrun¶
- generator¶
- env¶
waflib.ConfigSet.ConfigSet
object (make sure to provide one)
- inputs¶
List of input nodes, which represent the files used by the task instance
- outputs¶
List of output nodes, which represent the files created by the task instance
- dep_nodes¶
List of additional nodes to depend on
- run_after¶
Set of tasks that must be executed before this one
- __firstlineno__ = 31¶
- __static_attributes__ = ()¶
- hcode = b'nocode'¶
String representing an additional hash for the class representation
- class waflib.Tools.d.dstlib(*k, **kw)[source]¶
Link object files into a d static library
- hasrun¶
- generator¶
- env¶
waflib.ConfigSet.ConfigSet
object (make sure to provide one)
- inputs¶
List of input nodes, which represent the files used by the task instance
- outputs¶
List of output nodes, which represent the files created by the task instance
- dep_nodes¶
List of additional nodes to depend on
- run_after¶
Set of tasks that must be executed before this one
- __firstlineno__ = 35¶
- __static_attributes__ = ()¶
- hcode = b'\t\tdef composed_fun(task):\n\t\t\tfor x in funs_lst:\n\t\t\t\tret = x(task)\n\t\t\t\tif ret:\n\t\t\t\t\treturn ret\n\t\t\treturn None\n'¶
String representing an additional hash for the class representation
- waflib.Tools.d.d_hook(self, node)[source]¶
Compile D files. To get .di files as well as .o files, set the following:
def build(bld): bld.program(source='foo.d', target='app', generate_headers=True)
- waflib.Tools.d.generate_header(self, filename)[source]¶
Task generator method
See feature request #104:
def build(bld): tg = bld.program(source='foo.d', target='app') tg.generate_header('blah.d') # is equivalent to: #tg = bld.program(source='foo.d', target='app', header_lst='blah.d')
- Parameters:
filename (string) – header to create
- waflib.Tools.d.process_header(self)[source]¶
Task generator method
Process the attribute ‘header_lst’ to create the d header compilation tasks:
def build(bld): bld.program(source='foo.d', target='app', header_lst='blah.d') :feature: `d <../featuremap.html#feature-d>`_
Features defined in this module: