d

class waflib.Tools.d.d(*k, **kw)[source]

Bases: waflib.Task.Task

Compile a d file into an object file

scan()

look for .d/.di used by a d file

class waflib.Tools.d.d_with_header(*k, **kw)[source]

Bases: waflib.Tools.d.d

Compile a d file and generate a header

class waflib.Tools.d.d_header(*k, **kw)[source]

Bases: waflib.Task.Task

Compile d headers

class waflib.Tools.d.dprogram(*k, **kw)[source]

Bases: waflib.Tools.ccroot.link_task

Link object files into a d program

class waflib.Tools.d.dshlib(*k, **kw)[source]

Bases: waflib.Tools.d.dprogram

Link object files into a d shared library

class waflib.Tools.d.dstlib(*k, **kw)[source]

Bases: waflib.Tools.ccroot.stlink_task

Link object files into a d static library

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, install_path=None)[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
  • install_path – unused (TODO)
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: register a 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: register 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

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.

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

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

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

waflib.Tools.d.extension(*k)

Decorator: register 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')

Features defined in this module:

Previous topic

d_config

Next topic

d_scan

This Page