xpybuild.utils.compilers¶
Support classes for the C/C++ native compiler chain, used by the xpybuild.targets.native
module.
Process¶
Compiler¶
-
class
xpybuild.utils.compilers.
Compiler
(environs=None)[source]¶ Bases:
xpybuild.utils.compilers.Process
A compiler (of some sort or other)
Depends¶
-
class
xpybuild.utils.compilers.
Depends
(environs=None)[source]¶ Bases:
xpybuild.utils.compilers.Process
The command to use to generate a list of dependencies from a list of source files
Linker¶
-
class
xpybuild.utils.compilers.
Linker
(environs=None)[source]¶ Bases:
xpybuild.utils.compilers.Process
Link a set of object files into an executable or a shared library
-
link
(context, output, src, options, shared=False, flags=None, libs=None, libdirs=None)[source]¶ output: The library/executable to create
src: A list of object file paths
options: an options dictionary to override global options
flags: additional flags to pass to the compiler
libs: A list of libraries to link against
libdirs: A list of paths to directories that contain libraries
-
Archiver¶
-
class
xpybuild.utils.compilers.
Archiver
(environs=None)[source]¶ Bases:
xpybuild.utils.compilers.Process
A tool to put a set of object files into an archive for static linking. Typically only used on unix.
ToolChain¶
-
class
xpybuild.utils.compilers.
ToolChain
(depends, ccompiler, cxxcompiler, linker, archiver)[source]¶ Bases:
object
A collection of compilers, linkers and other tools which represents a complete native tool chain
depends: A Depends object to get a list of dependencies from a list of source files
ccompiler: A Compiler object for compiling C files
cxxcompiler: A Compiler object for compiling C++ files
linker: A Linker object for linking object files to a shared library or executable
archiver: An Archiver object for making static-link archives
UnixCompiler¶
-
class
xpybuild.utils.compilers.
UnixCompiler
(command, outputHandler=None, environs=None)[source]¶ Bases:
xpybuild.utils.compilers.Compiler
A compiler using standard Unix compiler arguments/syntax
command: The path to the compiler
outputHandler: a ProcessOutputHandler to parse the output of the compiler
UnixLinker¶
-
class
xpybuild.utils.compilers.
UnixLinker
(command, outputHandler=None, environs=None)[source]¶ Bases:
xpybuild.utils.compilers.Linker
A linker using standard Unix linker arguments/syntax
command: The path to the linker
outputHandler: a ProcessOutputHandler to parse the output of the linker
UnixArchiver¶
-
class
xpybuild.utils.compilers.
UnixArchiver
(command, outputHandler=None, environs=None)[source]¶ Bases:
xpybuild.utils.compilers.Archiver
A archiver using standard Unix archiver arguments/syntax
command: The path to the archiver
outputHandler: a ProcessOutputHandler to parse the output of the archiver
GccProcessOutputHandler¶
-
class
xpybuild.utils.compilers.
GccProcessOutputHandler
(name, treatStdErrAsErrors=True, **kwargs)[source]¶ Bases:
xpybuild.utils.outputhandler.ProcessOutputHandler
A ProcessOutputHandler than can parse the output of GCC tools
Subclasses must pass any
**kwargs
down to the super() constructor to allow for new functionality to be added in future.- Parameters
name – a short display name for this process or target, used as a prefix for log lines.
treatStdErrAsErrors – controls whether all content on stderr (rather than stdout) is treated as an error by default. The correct setting depends on how the process being invoked uses stdout/err.
options – a dictionary of resolved option values, in case aspects of this handler are customizable. Available to implementations as
self.options
(if None is passed,self.options
will be an empty dictionary)
GCC¶
-
class
xpybuild.utils.compilers.
GCC
(environs=None)[source]¶ Bases:
xpybuild.utils.compilers.ToolChain
,xpybuild.utils.compilers.UnixCompiler
,xpybuild.utils.compilers.UnixLinker
,xpybuild.utils.compilers.Depends
A tool chain based on the GNU Compiler Collection
VisualStudioProcessOutputHandler¶
-
class
xpybuild.utils.compilers.
VisualStudioProcessOutputHandler
(name, treatStdErrAsErrors=True, **kwargs)[source]¶ Bases:
xpybuild.utils.outputhandler.ProcessOutputHandler
A ProcessOutputHandler that can parse the output of Visual Studio tools
Subclasses must pass any
**kwargs
down to the super() constructor to allow for new functionality to be added in future.- Parameters
name – a short display name for this process or target, used as a prefix for log lines.
treatStdErrAsErrors – controls whether all content on stderr (rather than stdout) is treated as an error by default. The correct setting depends on how the process being invoked uses stdout/err.
options – a dictionary of resolved option values, in case aspects of this handler are customizable. Available to implementations as
self.options
(if None is passed,self.options
will be an empty dictionary)
VisualStudio¶
-
class
xpybuild.utils.compilers.
VisualStudio
(vsbin)[source]¶ Bases:
xpybuild.utils.compilers.Compiler
,xpybuild.utils.compilers.Linker
,xpybuild.utils.compilers.Depends
,xpybuild.utils.compilers.Archiver
,xpybuild.utils.compilers.ToolChain
A ToolChain representing using Visual Studio compilers et al