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')

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().

Inheritance diagram of 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

Color for the console display, see waflib.Logs.colors_lst

Try to process link tasks as early as possible

Default installation path for the link task outputs, or None to disable

Default installation mode for the link task outputs

Process the target attribute to add the platform-specific prefix/suffix such as .so or .exe. The settings are retrieved from env.clsname_PATTERN

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:

  1. cwd: current working directory (Node or string)

  2. stdout: set to None to prevent waf from capturing the process standard output

  3. stderr: set to None to prevent waf from capturing the process standard error

  4. timeout: timeout value (Python 3)

Create manifest files for VS-like compilers (msvc, ifort, …)

waflib.ConfigSet.ConfigSet object (make sure to provide one)

List of input nodes, which represent the files used by the task instance

List of output nodes, which represent the files created by the task instance

List of additional nodes to depend on

Set of tasks that must be executed before this one

Base for static link tasks, which use ar most of the time. The target is always removed before being written.

Default installation mode for the static libraries

waflib.ConfigSet.ConfigSet object (make sure to provide one)

List of input nodes, which represent the files used by the task instance

List of output nodes, which represent the files created by the task instance

List of additional nodes to depend on

Set of tasks that must be executed before this one

String representing an additional hash for the class representation

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

d

Features defined in this module: