SCons.Tool package#
Module contents#
SCons tool selection.
Looks for modules that define a callable object that can modify a construction environment as appropriate for a given tool (or tool chain).
Note that because this subsystem just selects a callable that can modify a construction environment, it’s possible for people to define their own “tool specification” in an arbitrary callable function. No one needs to use or tie in to this subsystem in order to roll their own tool specifications.
- SCons.Tool.CreateJarBuilder(env)[source]#
The Jar builder expects a list of class files which it can package into a jar file.
The jar tool provides an interface for passing other types of java files such as .java, directories or swig interfaces and will build them to class files in which it can package into the jar.
- class SCons.Tool.ToolInitializer(env, tools, names)[source]#
Bases:
object
A class for delayed initialization of Tools modules.
Instances of this class associate a list of Tool modules with a list of Builder method names that will be added by those Tool modules. As part of instantiating this object for a particular construction environment, we also add the appropriate ToolInitializerMethod objects for the various Builder methods that we want to use to delay Tool searches until necessary.
- class SCons.Tool.ToolInitializerMethod(name, initializer)[source]#
Bases:
object
This is added to a construction environment in place of a method(s) normally called for a Builder (env.Object, env.StaticObject, etc.). When called, it has its associated ToolInitializer object search the specified list of tools and apply the first one that exists to the construction environment. It then calls whatever builder was (presumably) added to the construction environment in place of this particular instance.
- SCons.Tool.createCFileBuilders(env)[source]#
This is a utility function that creates the CFile/CXXFile Builders in an Environment if they are not there already.
If they are there already, we return the existing ones.
This is a separate function because soooo many Tools use this functionality.
The return is a 2-tuple of (CFile, CXXFile)
- SCons.Tool.createLoadableModuleBuilder(env, loadable_module_suffix: str = '$_LDMODULESUFFIX')[source]#
This is a utility function that creates the LoadableModule Builder in an Environment if it is not there already.
If it is already there, we return the existing one.
- Parameters:
loadable_module_suffix – The suffix specified for the loadable module builder
- SCons.Tool.createObjBuilders(env)[source]#
This is a utility function that creates the StaticObject and SharedObject Builders in an Environment if they are not there already.
If they are there already, we return the existing ones.
This is a separate function because soooo many Tools use this functionality.
The return is a 2-tuple of (StaticObject, SharedObject)
- SCons.Tool.createProgBuilder(env)[source]#
This is a utility function that creates the Program Builder in an Environment if it is not there already.
If it is already there, we return the existing one.
This is a utility function that creates the SharedLibrary Builder in an Environment if it is not there already.
If it is already there, we return the existing one.
- Parameters:
shlib_suffix – The suffix specified for the shared library builder
- SCons.Tool.createStaticLibBuilder(env)[source]#
This is a utility function that creates the StaticLibrary Builder in an Environment if it is not there already.
If it is already there, we return the existing one.
- SCons.Tool.find_program_path(env, key_program, default_paths=None, add_path: bool = False) str | None [source]#
Find the location of a tool using various means.
Mainly for windows where tools aren’t all installed in /usr/bin, etc.
- Parameters:
env – Current Construction Environment.
key_program – Tool to locate.
default_paths – List of additional paths this tool might be found in.
add_path – If true, add path found if it was from default_paths.