c

Base for c programs/libraries

waflib.Tools.c.c_hook(self, node)[source]

Binds the c file extensions create waflib.Tools.c.c instances

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

Bases: waflib.Task.Task

Compiles C files into object files

vars = ['ARCH', 'ARCH_ST', 'CC', 'CCDEPS', 'CC_SRC_F', 'CC_TGT_F', 'CFLAGS', 'CPPFLAGS', 'CPPPATH_ST', 'DEFINES', 'DEFINES_ST', 'FRAMEWORKPATH', 'FRAMEWORKPATH_ST', 'INCPATHS']
ext_in = ['.h']
scan()

Get the dependencies using a c/c++ preprocessor, this is required for finding dependencies of the kind:

#include some_macro()

This function is bound as a task method on waflib.Tools.c.c and waflib.Tools.cxx.cxx for example

dep_nodes
env
generator
hasrun
hcode = b'${CC} ${ARCH_ST:ARCH} ${CFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CC_SRC_F}${SRC} ${CC_TGT_F}${TGT[0].abspath()} ${CPPFLAGS}'
inputs
orig_run_str = '${CC} ${ARCH_ST:ARCH} ${CFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CC_SRC_F}${SRC} ${CC_TGT_F}${TGT[0].abspath()} ${CPPFLAGS}'
outputs
run_after
class waflib.Tools.c.cprogram(*k, **kw)[source]

Bases: waflib.Tools.ccroot.link_task

Links object files into c programs

ext_out = ['.bin']
vars = ['ARCH', 'ARCH_ST', 'CCLNK_SRC_F', 'CCLNK_TGT_F', 'FRAMEWORK', 'FRAMEWORKPATH', 'FRAMEWORKPATH_ST', 'FRAMEWORK_ST', 'LDFLAGS', 'LIB', 'LIBPATH', 'LIBPATH_ST', 'LIB_ST', 'LINKDEPS', 'LINKFLAGS', 'LINK_CC', 'RPATH', 'RPATH_ST', 'SHLIB_MARKER', 'STLIB', 'STLIBPATH', 'STLIBPATH_ST', 'STLIB_MARKER', 'STLIB_ST']
inst_to = '${BINDIR}'
dep_nodes
env
generator
hasrun
hcode = b'${LINK_CC} ${LINKFLAGS} ${CCLNK_SRC_F}${SRC} ${CCLNK_TGT_F}${TGT[0].abspath()} ${RPATH_ST:RPATH} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${FRAMEWORK_ST:FRAMEWORK} ${ARCH_ST:ARCH} ${STLIB_MARKER} ${STLIBPATH_ST:STLIBPATH} ${STLIB_ST:STLIB} ${SHLIB_MARKER} ${LIBPATH_ST:LIBPATH} ${LIB_ST:LIB} ${LDFLAGS}'
inputs
orig_run_str = '${LINK_CC} ${LINKFLAGS} ${CCLNK_SRC_F}${SRC} ${CCLNK_TGT_F}${TGT[0].abspath()} ${RPATH_ST:RPATH} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${FRAMEWORK_ST:FRAMEWORK} ${ARCH_ST:ARCH} ${STLIB_MARKER} ${STLIBPATH_ST:STLIBPATH} ${STLIB_ST:STLIB} ${SHLIB_MARKER} ${LIBPATH_ST:LIBPATH} ${LIB_ST:LIB} ${LDFLAGS}'
outputs
run_after
class waflib.Tools.c.cshlib(*k, **kw)[source]

Bases: waflib.Tools.c.cprogram

Links object files into c shared libraries

inst_to = '${LIBDIR}'
dep_nodes
env
generator
hasrun
hcode = b'nocode'
inputs
outputs
run_after
class waflib.Tools.c.cstlib(*k, **kw)[source]

Bases: waflib.Tools.ccroot.stlink_task

Links object files into a c static libraries

dep_nodes
env
generator
hasrun
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'
inputs
outputs
run_after

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

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, …)

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.

Default installation mode for the static libraries