d¶
-
class
waflib.Tools.d.
d
(*k, **kw)[source]¶ Bases:
waflib.Task.Task
Compile a d file into an object file
-
color
= 'GREEN'¶
-
scan
()¶ look for .d/.di used by a d file
-
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}'¶
-
vars
= ['D', 'DFLAGS', 'DINC_ST', 'D_SRC_F', 'D_TGT_F', 'INCPATHS']¶
-
-
class
waflib.Tools.d.
d_with_header
(*k, **kw)[source]¶ Bases:
waflib.Tools.d.d
Compile a d file and generate a header
-
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()}'¶
-
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()']¶
-
-
class
waflib.Tools.d.
d_header
(*k, **kw)[source]¶ Bases:
waflib.Task.Task
Compile d headers
-
color
= 'BLUE'¶
-
hcode
= b'${D} ${D_HEADER} ${SRC}'¶
-
orig_run_str
= '${D} ${D_HEADER} ${SRC}'¶
-
vars
= ['D', 'D_HEADER']¶
-
-
class
waflib.Tools.d.
dprogram
(*k, **kw)[source]¶ Bases:
waflib.Tools.ccroot.link_task
Link object files into a d program
-
inst_to
= '${BINDIR}'¶
-
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}'¶
-
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']¶
-
-
class
waflib.Tools.d.
dshlib
(*k, **kw)[source]¶ Bases:
waflib.Tools.d.dprogram
Link object files into a d shared library
-
inst_to
= '${LIBDIR}'¶
-
hcode
= b'nocode'¶
-
-
class
waflib.Tools.d.
dstlib
(*k, **kw)[source]¶ Bases:
waflib.Tools.ccroot.stlink_task
Link object files into a d static library
-
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'¶
-
-
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
-
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.Task 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]¶ Bases:
waflib.Task.Task
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'¶
-
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)
-
-
class
waflib.Tools.d.
stlink_task
(*k, **kw)[source]¶ Bases:
waflib.Tools.ccroot.link_task
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
-
hcode
= b'${AR} ${ARFLAGS} ${AR_TGT_F}${TGT} ${AR_SRC_F}${SRC}'¶
-
orig_run_str
= '${AR} ${ARFLAGS} ${AR_TGT_F}${TGT} ${AR_SRC_F}${SRC}'¶
-
vars
= ['AR', 'ARFLAGS', 'AR_SRC_F', 'AR_TGT_F']¶
-
Features defined in this module: