Special python modules called Waf tools provide functions and classes to help using compilers, libraries or programs. The typical usage from a user script is:
def function(ctx): # ... ctx.load('toolname')
Where the function is usually:
options: add command-line options used by the tool
conf.env, raise a configuration error if a prerequisite is not met
The tools will usually enhance the application by adding:
new commands deriving from
new task classes deriving from
As a general rule, existing methods or classes are hardly ever replaced.
C/C++ compiler detection¶
The following Waf tools are used for loading specific C or C++ compilers. They may be used directly, for example:
def options(opt): opt.load('compiler_c') def configure(conf): conf.load('compiler_c')
The following modules contain the functions and classes required for building C and C++ applications. They
are almost always loaded by other Waf tools. Among these, the most important from a user point of view
waflib.Tools.c_config which provides the
D language and compilers¶
The first three tools in the following list may be used for detecting D compilers. The remaining contain the support functions and classes.
The first four tools in the following list are used for detecting fortran compilers. The three remaining contain the routines for compiling fortran applications.
Other compilers and tools¶
The following tools provide support for specific compilers or configurations. More tools are present in the extras folder, although they are not documented and as stable as the default tools.