c_aliases

base for all c/c++ programs and libraries

waflib.Tools.c_aliases.conf(f)

Decorator: attach new configuration functions to waflib.Build.BuildContext and waflib.Configure.ConfigurationContext. The methods bound will accept a parameter named ‘mandatory’ to disable the configuration errors:

def configure(conf):
        conf.find_program('abc', mandatory=False)
Parameters

f (function) – method to bind

waflib.Tools.c_aliases.get_extensions(lst)[source]

Returns the file extensions for the list of files given as input

Parameters

lst – files to process

List lst

list of string or waflib.Node.Node

Returns

list of file extensions

Return type

list of string

waflib.Tools.c_aliases.sniff_features(**kw)[source]

Computes and returns the features required for a task generator by looking at the file extensions. This aimed for C/C++ mainly:

snif_features(source=['foo.c', 'foo.cxx'], type='shlib')
# returns  ['cxx', 'c', 'cxxshlib', 'cshlib']
Parameters
  • source (list of string or waflib.Node.Node) – source files to process

  • type (string) – object type in program, shlib or stlib

Returns

the list of features for a task generator processing the source files

Return type

list of string

waflib.Tools.c_aliases.set_features(kw, typ)[source]

Inserts data in the input dict kw based on existing data and on the type of target required (typ).

Parameters
  • kw (dict) – task generator parameters

  • typ (string) – type of target

waflib.Tools.c_aliases.program(bld, *k, **kw)[source]

Configuration Method bound to waflib.Configure.ConfigurationContext

Alias for creating programs by looking at the file extensions:

def build(bld):
        bld.program(source='foo.c', target='app')
        # equivalent to:
        # bld(features='c cprogram', source='foo.c', target='app')
waflib.Tools.c_aliases.shlib(bld, *k, **kw)[source]

Configuration Method bound to waflib.Configure.ConfigurationContext

Alias for creating shared libraries by looking at the file extensions:

def build(bld):
        bld.shlib(source='foo.c', target='app')
        # equivalent to:
        # bld(features='c cshlib', source='foo.c', target='app')
waflib.Tools.c_aliases.stlib(bld, *k, **kw)[source]

Configuration Method bound to waflib.Configure.ConfigurationContext

Alias for creating static libraries by looking at the file extensions:

def build(bld):
        bld.stlib(source='foo.cpp', target='app')
        # equivalent to:
        # bld(features='cxx cxxstlib', source='foo.cpp', target='app')
waflib.Tools.c_aliases.objects(bld, *k, **kw)[source]

Configuration Method bound to waflib.Configure.ConfigurationContext

Alias for creating object files by looking at the file extensions:

def build(bld):
        bld.objects(source='foo.c', target='app')
        # equivalent to:
        # bld(features='c', source='foo.c', target='app')