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__ = {}¶
- class waflib.Tools.d.stlink_task(*k, **kw)[source]¶
Base for static link tasks, which use ar most of the time. The target is always removed before being written.
- 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__ = {}¶
- hcode = b'${AR} ${ARFLAGS} ${AR_TGT_F}${TGT} ${AR_SRC_F}${SRC}'¶
String representing an additional hash for the class representation
- orig_run_str = '${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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- hcode = b'\tdef wrap(self):\n\t\ttry:\n\t\t\tos.remove(self.outputs[0].abspath())\n\t\texcept OSError:\n\t\t\tpass\n\t\treturn old(self)\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
Features defined in this module: