c¶
Base for c programs/libraries
- class waflib.Tools.c.link_task(*k, **kw)[source]¶
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()
.- color = 'YELLOW'¶
Color for the console display, see
waflib.Logs.colors_lst
- weight = 3¶
Try to process link tasks as early as possible
- inst_to = None¶
Default installation path for the link task outputs, or None to disable
- chmod = 493¶
Default installation mode for the link task outputs
- add_target(target)[source]¶
Process the target attribute to add the platform-specific prefix/suffix such as .so or .exe. The settings are retrieved from
env.clsname_PATTERN
- exec_command(*k, **kw)[source]¶
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:
cwd: current working directory (Node or string)
stdout: set to None to prevent waf from capturing the process standard output
stderr: set to None to prevent waf from capturing the process standard error
timeout: timeout value (Python 3)
- hasrun¶
- generator¶
- env¶
waflib.ConfigSet.ConfigSet
object (make sure to provide one)
- inputs¶
List of input nodes, which represent the files used by the task instance
- outputs¶
List of output nodes, which represent the files created by the task instance
- dep_nodes¶
List of additional nodes to depend on
- run_after¶
Set of tasks that must be executed before this one
- __dict__ = mappingproxy({'__module__': 'waflib.Tools.ccroot', '__firstlineno__': 130, '__doc__': '\nBase class for all link tasks. A task generator is supposed to have at most one link task bound in the attribute *link_task*. See :py:func:`waflib.Tools.ccroot.apply_link`.\n\n.. inheritance-diagram:: 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\n :top-classes: waflib.Tools.ccroot.link_task\n', 'color': 'YELLOW', 'weight': 3, 'inst_to': None, 'chmod': 493, 'add_target': <function link_task.add_target>, 'exec_command': <function link_task.exec_command>, 'exec_mf': <function link_task.exec_mf>, '__static_attributes__': (), '__dict__': <attribute '__dict__' of 'link_task' objects>, '__weakref__': <attribute '__weakref__' of 'link_task' objects>, '__annotations__': {}})¶
- __firstlineno__ = 130¶
- __static_attributes__ = ()¶
- class waflib.Tools.c.stlink_task(*k, **kw)[source]¶
Base for static link tasks, which use ar most of the time.
- run_str = None¶
- chmod = 420¶
Default installation mode for the static libraries
- hasrun¶
- generator¶
- env¶
waflib.ConfigSet.ConfigSet
object (make sure to provide one)
- inputs¶
List of input nodes, which represent the files used by the task instance
- outputs¶
List of output nodes, which represent the files created by the task instance
- dep_nodes¶
List of additional nodes to depend on
- run_after¶
Set of tasks that must be executed before this one
- __firstlineno__ = 225¶
- __static_attributes__ = ()¶
- hcode = b"[b'\\t\\tlambda task: task.remove_before_build(),\\n', b'${AR} ${ARFLAGS} ${AR_TGT_F}${TGT} ${AR_SRC_F}${SRC}']"¶
String representing an additional hash for the class representation
- orig_run_str = [<function stlink_task.<lambda>>, '${AR} ${ARFLAGS} ${AR_TGT_F}${TGT} ${AR_SRC_F}${SRC}']¶
- vars = ['AR', 'ARFLAGS', 'AR_SRC_F', 'AR_TGT_F']¶
ConfigSet variables that should trigger a rebuild (class attribute used for
waflib.Task.Task.sig_vars()
)
- 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]¶
Compiles C files into object files
- run_str = None¶
- vars = ['ARCH', 'ARCH_ST', 'CC', 'CCDEPS', 'CC_SRC_F', 'CC_TGT_F', 'CFLAGS', 'CPPFLAGS', 'CPPPATH_ST', 'DEFINES', 'DEFINES_ST', 'FRAMEWORKPATH', 'FRAMEWORKPATH_ST', 'INCPATHS']¶
ConfigSet variables that should trigger a rebuild (class attribute used for
waflib.Task.Task.sig_vars()
)
- ext_in = ['.h']¶
File extensions that objects of this task class may use
- 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
andwaflib.Tools.cxx.cxx
for example
- hasrun¶
- generator¶
- env¶
waflib.ConfigSet.ConfigSet
object (make sure to provide one)
- inputs¶
List of input nodes, which represent the files used by the task instance
- outputs¶
List of output nodes, which represent the files created by the task instance
- dep_nodes¶
List of additional nodes to depend on
- run_after¶
Set of tasks that must be executed before this one
- __dict__ = mappingproxy({'__module__': 'waflib.Tools.c', '__firstlineno__': 18, '__doc__': 'Compiles C files into object files', 'run_str': None, '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': <function scan>, '__static_attributes__': (), '__dict__': <attribute '__dict__' of 'c' objects>, '__weakref__': <attribute '__weakref__' of 'c' objects>, '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}', '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}', 'run': <function f>, '__annotations__': {}})¶
- __firstlineno__ = 18¶
- __static_attributes__ = ()¶
- 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}'¶
String representing an additional hash for the class representation
- 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}'¶
- class waflib.Tools.c.cprogram(*k, **kw)[source]¶
Links object files into c programs
- run_str = None¶
- ext_out = ['.bin']¶
File extensions that objects of this task class may create
- 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']¶
ConfigSet variables that should trigger a rebuild (class attribute used for
waflib.Task.Task.sig_vars()
)
- inst_to = '${BINDIR}'¶
Default installation path for the link task outputs, or None to disable
- hasrun¶
- generator¶
- env¶
waflib.ConfigSet.ConfigSet
object (make sure to provide one)
- inputs¶
List of input nodes, which represent the files used by the task instance
- outputs¶
List of output nodes, which represent the files created by the task instance
- dep_nodes¶
List of additional nodes to depend on
- run_after¶
Set of tasks that must be executed before this one
- __firstlineno__ = 25¶
- __static_attributes__ = ()¶
- 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}'¶
String representing an additional hash for the class representation
- 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}'¶
- class waflib.Tools.c.cshlib(*k, **kw)[source]¶
Links object files into c shared libraries
- inst_to = '${LIBDIR}'¶
Default installation path for the link task outputs, or None to disable
- hasrun¶
- generator¶
- env¶
waflib.ConfigSet.ConfigSet
object (make sure to provide one)
- inputs¶
List of input nodes, which represent the files used by the task instance
- outputs¶
List of output nodes, which represent the files created by the task instance
- dep_nodes¶
List of additional nodes to depend on
- run_after¶
Set of tasks that must be executed before this one
- __firstlineno__ = 32¶
- __static_attributes__ = ()¶
- hcode = b'nocode'¶
String representing an additional hash for the class representation
- class waflib.Tools.c.cstlib(*k, **kw)[source]¶
Links object files into a c static libraries
- hasrun¶
- generator¶
- env¶
waflib.ConfigSet.ConfigSet
object (make sure to provide one)
- inputs¶
List of input nodes, which represent the files used by the task instance
- outputs¶
List of output nodes, which represent the files created by the task instance
- dep_nodes¶
List of additional nodes to depend on
- run_after¶
Set of tasks that must be executed before this one
- __firstlineno__ = 36¶
- __static_attributes__ = ()¶
- hcode = b'\t\tdef composed_fun(task):\n\t\t\tfor x in funs_lst:\n\t\t\t\tret = x(task)\n\t\t\t\tif ret:\n\t\t\t\t\treturn ret\n\t\t\treturn None\n'¶
String representing an additional hash for the class representation