Support for Python, detect the headers and libraries and provide use variables to link C/C++ programs against them:
def options(opt):
opt.load('compiler_c python')
def configure(conf):
conf.load('compiler_c python')
conf.check_python_version((2,4,2))
conf.check_python_headers()
def build(bld):
bld.program(features='pyembed', source='a.c', target='myprog')
bld.shlib(features='pyext', source='b.c', target='mylib')
Piece of C/C++ code used in waflib.Tools.python.check_python_headers()
Piece of Python code used in waflib.Tools.python.install_pyfile() for installing python files
Add a callback using waflib.Tools.python.install_pyfile() to install a python file
Execute the installation of a python file
Parameters: | node (waflib.Node.Node) – python file |
---|
Task generator method
Dummy feature which does nothing
Feature : | py |
---|
Task generator method
Change the values of cshlib_PATTERN and cxxshlib_PATTERN to remove the lib prefix from library names.
Feature : | pyext |
---|
Task generator method
Add the PYEMBED variable.
Feature : | pyembed |
---|
Configuration Method bound to waflib.Configure.ConfigurationContext
Spawn a new python process to dump configuration variables
Parameters: |
|
---|---|
Returns: | the variable values |
Return type: | list of string |
Configuration Method bound to waflib.Configure.ConfigurationContext
Check for headers and libraries necessary to extend or embed python by using the module distutils. On success the environment variables xxx_PYEXT and xxx_PYEMBED are added:
Configuration Method bound to waflib.Configure.ConfigurationContext
Check if the python interpreter is found matching a given minimum version. minver should be a tuple, eg. to check for python >= 2.4.2 pass (2,4,2) as minver.
If successful, PYTHON_VERSION is defined as ‘MAJOR.MINOR’ (eg. ‘2.4’) of the actual python version found, and PYTHONDIR is defined, pointing to the site-packages directory appropriate for this python version, where modules/packages/extensions should be installed.
Parameters: | minver (tuple of int) – minimum version |
---|
Configuration Method bound to waflib.Configure.ConfigurationContext
Check if the selected python interpreter can import the given python module:
def configure(conf):
conf.check_python_module('pygccxml')
Parameters: | module_name (string) – module |
---|
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 |
---|
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 |
---|
Decorator: register a task generator method which will be executed before the functions of given name(s):
from waflib.TaskGen import feature, before
@feature('myfeature')
@before_method('fun2')
def fun1(self):
print('feature 1!')
@feature('myfeature')
def fun2(self):
print('feature 2!')
def build(bld):
bld(features='myfeature')
Parameters: | k (list of string) – method names |
---|
Decorator: register a task generator method which will be executed after the functions of given name(s):
from waflib.TaskGen import feature, after
@feature('myfeature')
@after_method('fun2')
def fun1(self):
print('feature 1!')
@feature('myfeature')
def fun2(self):
print('feature 2!')
def build(bld):
bld(features='myfeature')
Parameters: | k (list of string) – method names |
---|
Wrap logging.warn
Wrap logging.info
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')
Wrap logging.errors, display the origin of the message when ‘-vv’ is set
Wrap logging.debug, the output is filtered for performance reasons
Features defined in this module: