scons.1 (scons-4.2.0) | : | scons.1 (SCons-4.3.0) | ||
---|---|---|---|---|
SCONS(1) SCons 4.2.0 SCONS(1) | SCONS(1) SCons 4.3.0 SCONS(1) | |||
NAME | NAME | |||
scons - a software construction tool | scons - a software construction tool | |||
SYNOPSIS | SYNOPSIS | |||
scons [options...] [name=val...] [targets...] | scons [options...] [name=val...] [targets...] | |||
DESCRIPTION | DESCRIPTION | |||
scons orchestrates the construction of software (and other tangible produ cts such as documentation files) | scons orchestrates the construction of software (and other tangible produ cts such as documentation files) | |||
by determining which component pieces must be built or rebuilt and invoki ng the necessary commands to | by determining which component pieces must be built or rebuilt and invoki ng the necessary commands to | |||
skipping to change at line 461 | skipping to change at line 461 | |||
Set the hashing algorithm used by SCons to ALGORITHM. This value dete rmines the hashing algorithm | Set the hashing algorithm used by SCons to ALGORITHM. This value dete rmines the hashing algorithm | |||
used in generating content signatures or CacheDir keys. | used in generating content signatures or CacheDir keys. | |||
The supported list of values are: md5, sha1, and sha256. However, the Python interpreter used to run | The supported list of values are: md5, sha1, and sha256. However, the Python interpreter used to run | |||
SCons must have the corresponding support available in the hashlib mo dule to use the specified | SCons must have the corresponding support available in the hashlib mo dule to use the specified | |||
algorithm. | algorithm. | |||
Specifying this value changes the name of the SConsign database. For example, --hash-format=sha256 | Specifying this value changes the name of the SConsign database. For example, --hash-format=sha256 | |||
will create a SConsign database with name .sconsign_sha256.dblite. | will create a SConsign database with name .sconsign_sha256.dblite. | |||
If this option is not specified, a hash format of md5 is used, and th | If this option is not specified, a the first supported hash format fo | |||
e SConsign database is | und is selected. Typically this | |||
.sconsign.dblite. | is MD5, however, if you are on a FIPS-compliant system and using a ve | |||
rsion of Python less than 3.9, | ||||
SHA1 or SHA256 will be chosen as the default. Python 3.9 and onwards | ||||
clients will always default to | ||||
MD5, even in FIPS mode, unless otherwise specified with the --hash-fo | ||||
rmat option. | ||||
For MD5 databases (either explicitly specified with --hash-format=md5 | ||||
or defaulted), the SConsign | ||||
database is.sconsign.dblite. The newer SHA1 and SHA256 selections mea | ||||
nwhile store their databases to | ||||
.sconsign_algorithmname.dblite | ||||
Available since scons 4.2. | Available since scons 4.2. | |||
-H, --help-options | -H, --help-options | |||
Print the standard help message about SCons command-line options and exit. | Print the standard help message about SCons command-line options and exit. | |||
-i, --ignore-errors | -i, --ignore-errors | |||
Ignore all errors from commands executed to rebuild files. | Ignore all errors from commands executed to rebuild files. | |||
-I directory, --include-dir=directory | -I directory, --include-dir=directory | |||
skipping to change at line 759 | skipping to change at line 765 | |||
Print the scons version, copyright information, list of authors, and any other relevant information. | Print the scons version, copyright information, list of authors, and any other relevant information. | |||
Then exit. | Then exit. | |||
-w, --print-directory | -w, --print-directory | |||
Print a message containing the working directory before and after oth er processing. | Print a message containing the working directory before and after oth er processing. | |||
--no-print-directory | --no-print-directory | |||
Turn off -w, even if it was turned on implicitly. | Turn off -w, even if it was turned on implicitly. | |||
--warn=type, --warn=no-type | --warn=type, --warn=no-type | |||
Enable or disable (with the no- prefix) warnings. type specifies the | Enable or disable (with the prefix "no-") warnings (--warning is a sy | |||
type of warnings to be enabled | nonym). type specifies the type | |||
or disabled: | of warnings to be enabled or disabled: | |||
all | all | |||
All warnings. | All warnings. | |||
cache-version | cache-version | |||
Warnings about the derived-file cache directory specified by Cach eDir not using the latest | Warnings about the derived-file cache directory specified by Cach eDir not using the latest | |||
configuration information. These warnings are enabled by default. | configuration information. These warnings are enabled by default. | |||
cache-write-error | cache-write-error | |||
Warnings about errors trying to write a copy of a built file to a specified derived-file cache | Warnings about errors trying to write a copy of a built file to a specified derived-file cache | |||
skipping to change at line 809 | skipping to change at line 815 | |||
about to-be-deprecated features that may require changes to the c onfiguration. | about to-be-deprecated features that may require changes to the c onfiguration. | |||
link | link | |||
Warnings about link steps. | Warnings about link steps. | |||
misleading-keywords | misleading-keywords | |||
Warnings about the use of two commonly misspelled keywords target s and sources to Builder calls. | Warnings about the use of two commonly misspelled keywords target s and sources to Builder calls. | |||
The correct spelling is the singular form, even though target and source can themselves refer to | The correct spelling is the singular form, even though target and source can themselves refer to | |||
lists of names or nodes. | lists of names or nodes. | |||
tool-qt-deprecated | ||||
Warnings about the qt tool being deprecated. These warnings are d | ||||
isabled by default for the first | ||||
phase of deprecation. Enable to be reminded about use of this too | ||||
l module. Available since SCons | ||||
4.3. | ||||
missing-sconscript | missing-sconscript | |||
Warnings about missing SConscript files. These warnings are enabl ed by default. | Warnings about missing SConscript files. These warnings are enabl ed by default. | |||
no-object-count | no-object-count | |||
Warnings about the --debug=object feature not working when scons is run with the Python -O option | Warnings about the --debug=object feature not working when scons is run with the Python -O option | |||
or from optimized Python (.pyo) modules. | or from optimized Python (.pyo) modules. | |||
no-parallel-support | no-parallel-support | |||
Warnings about the version of Python not being able to support pa rallel builds when the -j option | Warnings about the version of Python not being able to support pa rallel builds when the -j option | |||
is used. These warnings are enabled by default. | is used. These warnings are enabled by default. | |||
skipping to change at line 872 | skipping to change at line 883 | |||
Tools | Tools | |||
Builder Methods | Builder Methods | |||
Methods and Functions to do Things | Methods and Functions to do Things | |||
SConscript Variables | SConscript Variables | |||
Construction Variables | Construction Variables | |||
Configure Contexts | Configure Contexts | |||
Command-Line Construction Variables | Command-Line Construction Variables | |||
Node Objects | Node Objects | |||
Construction Environments | Construction Environments | |||
A Construction Environment is the basic means by which SConscript files c | A Construction Environment is the basic means by which you communicate bu | |||
ommunicate build information to | ild information to SCons. A new | |||
scons. A new construction environment is created using the Environment fu | construction environment is created using the Environment function: | |||
nction: | ||||
env = Environment() | env = Environment() | |||
Construction environment attributes called Construction Variables may be set either by specifying them as | Construction environment attributes called Construction Variables may be set either by specifying them as | |||
keyword arguments when the object is created or by assigning them a value after the object is created. | keyword arguments when the object is created or by assigning them a value after the object is created. | |||
These two are nominally equivalent: | These two are nominally equivalent: | |||
env = Environment(FOO='foo') | env = Environment(FOO='foo') | |||
env['FOO'] = 'foo' | env['FOO'] = 'foo' | |||
Note that certain settings which affect tool detection are referenced onl | Note that certain settings which affect tool detection are referenced onl | |||
y during initialization, and so | y when the tools are | |||
need to be supplied as part of the call to Environment. For example, sett | initializided, so you either need either to supply them as part of the ca | |||
ing $MSVC_VERSION selects the | ll to Environment, or defer tool | |||
version of Microsoft Visual C++ you wish to use, but setting it after the | initialization. For example, initializing the Microsoft Visual C++ versio | |||
construction environment is | n you wish to use: | |||
constructed has no effect. | ||||
# initializes msvc to v14.1 | ||||
env = Environment(MSVC_VERSION="14.1") | ||||
env = Environment() | ||||
# msvc tool was initialized to default, does not reinitialize | ||||
env['MSVC_VERSION'] = "14.1" | ||||
env = Environment(tools=[]) | ||||
env['MSVC_VERSION'] = "14.1" | ||||
# msvc tool initialization was deferred, so will pick up new value | ||||
env.Tool('default') | ||||
As a convenience, construction variables may also be set or modified by t he parse_flags keyword argument | As a convenience, construction variables may also be set or modified by t he parse_flags keyword argument | |||
during object creation, which has the effect of the env.MergeFlags method being applied to the argument | during object creation, which has the effect of the env.MergeFlags method being applied to the argument | |||
value after all other processing is completed. This is useful either if t he exact content of the flags is | value after all other processing is completed. This is useful either if t he exact content of the flags is | |||
unknown (for example, read from a control file) or if the flags need to b e distributed to a number of | unknown (for example, read from a control file) or if the flags need to b e distributed to a number of | |||
construction variables. env.ParseFlags describes how these arguments are distributed to construction | construction variables. env.ParseFlags describes how these arguments are distributed to construction | |||
variables. | variables. | |||
env = Environment(parse_flags='-Iinclude -DEBUG -lm') | env = Environment(parse_flags='-Iinclude -DEBUG -lm') | |||
skipping to change at line 913 | skipping to change at line 935 | |||
SCons provides a special construction environment called the Default Envi ronment. The default environment | SCons provides a special construction environment called the Default Envi ronment. The default environment | |||
is used only for global functions, that is, construction activities calle d without the context of a | is used only for global functions, that is, construction activities calle d without the context of a | |||
regular construction environment. See DefaultEnvironment for more informa tion. | regular construction environment. See DefaultEnvironment for more informa tion. | |||
By default, a new construction environment is initialized with a set of b uilder methods and construction | By default, a new construction environment is initialized with a set of b uilder methods and construction | |||
variables that are appropriate for the current platform. The optional pla tform keyword argument may be | variables that are appropriate for the current platform. The optional pla tform keyword argument may be | |||
used to specify that the construction environment should be initialized f or a different platform: | used to specify that the construction environment should be initialized f or a different platform: | |||
env = Environment(platform='cygwin') | env = Environment(platform='cygwin') | |||
env = Environment(platform='os2') | ||||
env = Environment(platform='posix') | ||||
env = Environment(platform='win32') | ||||
Specifying a platform initializes the appropriate construction variables in the environment to use and | Specifying a platform initializes the appropriate construction variables in the environment to use and | |||
generate file names with prefixes and suffixes appropriate for that platf orm. | generate file names with prefixes and suffixes appropriate for that platf orm. | |||
Note that the win32 platform adds the SystemDrive and SystemRoot variable s from the user's external | Note that the win32 platform adds the SystemDrive and SystemRoot variable s from the user's external | |||
environment to the construction environment's ENV dictionary. This is so that any executed commands that | environment to the construction environment's ENV dictionary. This is so that any executed commands that | |||
use sockets to connect with other systems (such as fetching source files | use sockets to connect with other systems will work on Windows systems. | |||
from external CVS repository | ||||
specifications like :pserver:anonymous@cvs.sourceforge.net:/cvsroot/scons | ||||
) will work on Windows systems. | ||||
The platform argument may be a function or callable object, in which case | The platform argument may be a string value representing one of the pre-d | |||
the Environment method will | efined platforms (aix, cygwin, | |||
call it to update the new construction environment: | darwin, hpux, irix, os2, posix, sunos or win32), or it may be be a callab | |||
le platform object returned by a | ||||
call to Platform selecting a pre-defined platform, or it may be a user-su | ||||
pplied callable, in which case | ||||
the Environment method will call it to update the new construction enviro | ||||
nment: | ||||
def my_platform(env): | def my_platform(env): | |||
env['VAR'] = 'xyzzy' | env['VAR'] = 'xyzzy' | |||
env = Environment(platform=my_platform) | env = Environment(platform=my_platform) | |||
Note that supplying a non-default platform or custom fuction for initiali | ||||
zation may bypass settings that | ||||
should happen for the host system and should be used with care. It is mos | ||||
t useful in the case where the | ||||
platform is an alternative for the one that would be auto-detected, such | ||||
as platform="cygwin" on a system | ||||
which would otherwise identify as win32. | ||||
The optional tools and toolpath keyword arguments affect the way tools av ailable to the environment are | The optional tools and toolpath keyword arguments affect the way tools av ailable to the environment are | |||
initialized. See the section called “Tools” for details. | initialized. See the section called “Tools” for details. | |||
The optional variables keyword argument allows passing a Variables object which will be used in the | The optional variables keyword argument allows passing a Variables object which will be used in the | |||
initialization of the construction environment See the section called “Co mmand-Line Construction | initialization of the construction environment See the section called “Co mmand-Line Construction | |||
Variables” for details. | Variables” for details. | |||
Tools | Tools | |||
SCons has a large number of predefined tools (more properly, tool specifi cations) which are used to help | SCons has a large number of predefined tools (more properly, tool specifi cations) which are used to help | |||
initialize the construction environment. An scons tool is only responsibl e for setup. For example, if the | initialize the construction environment. An SCons tool is only responsibl e for setup. For example, if the | |||
SConscript file declares the need to construct an object file from a C-la nguage source file by calling | SConscript file declares the need to construct an object file from a C-la nguage source file by calling | |||
the Object builder, then a tool representing an available C compiler need s to have run first, to set up | the Object builder, then a tool representing an available C compiler need s to have run first, to set up | |||
the builder and all the construction variables it needs in the associated construction environment; the | that builder and all the construction variables it needs in the associate d construction environment; the | |||
tool itself is not called in the process of the build. Normally this happ ens invisibly: scons has | tool itself is not called in the process of the build. Normally this happ ens invisibly: scons has | |||
per-platform lists of default tools, and it runs through those tools, cal ling the ones which are actually | per-platform lists of default tools, and it runs through those tools, cal ling the ones which are actually | |||
applicable, skipping those where necessary programs are not installed on the build system, or other | applicable, skipping those where necessary programs are not installed on the build system, or other | |||
preconditions are not met. | preconditions are not met. | |||
A specific set of tools with which to initialize an environment when crea ting it may be specified using | A specific set of tools with which to initialize an environment when crea ting it may be specified using | |||
the optional keyword argument tools, which takes a list of tool names. Th is is useful to override the | the optional keyword argument tools, which takes a list of tool names. Th is is useful to override the | |||
defaults, to specify non-default built-in tools, and to supply added tool s: | defaults, to specify non-default built-in tools, and to supply added tool s: | |||
env = Environment(tools=['msvc', 'lex']) | env = Environment(tools=['msvc', 'lex']) | |||
skipping to change at line 1695 | skipping to change at line 1720 | |||
Uses: $ASCOMSTR, $ASPPCOMSTR. | Uses: $ASCOMSTR, $ASPPCOMSTR. | |||
ninja | ninja | |||
Sets up Ninja builder which generates a ninja build file, and then op tionally runs ninja. | Sets up Ninja builder which generates a ninja build file, and then op tionally runs ninja. | |||
Note | Note | |||
This is an experimental feature. | This is an experimental feature. | |||
This functionality is subject to change and/or removal without de precation cycle. | This functionality is subject to change and/or removal without de precation cycle. | |||
Sets: $IMPLICIT_COMMAND_DEPENDENCIES, $NINJA_ALIAS_NAME, $NINJA_COMPD B_EXPAND, $NINJA_DIR, | Sets: $IMPLICIT_COMMAND_DEPENDENCIES, $NINJA_ALIAS_NAME, $NINJA_COMPD B_EXPAND, $NINJA_DIR, | |||
$NINJA_DISABLE_AUTO_RUN, $NINJA_ENV_VAR_CACHE, $NINJA_FILE_NAME, $NIN | $NINJA_DISABLE_AUTO_RUN, $NINJA_ENV_VAR_CACHE, $NINJA_FILE_NAME, $NIN | |||
JA_GENERATED_SOURCE_SUFFIXES, | JA_FORCE_SCONS_BUILD, | |||
$NINJA_MSVC_DEPS_PREFIX, $NINJA_POOL, $NINJA_REGENERATE_DEPS, $NINJA_ | $NINJA_GENERATED_SOURCE_SUFFIXES, $NINJA_MSVC_DEPS_PREFIX, $NINJA_POO | |||
SYNTAX, | L, $NINJA_REGENERATE_DEPS, | |||
$_NINJA_REGENERATE_DEPS_FUNC, $__NINJA_NO. | $NINJA_SYNTAX, $_NINJA_REGENERATE_DEPS_FUNC, $__NINJA_NO. | |||
Uses: $AR, $ARCOM, $ARFLAGS, $CC, $CCCOM, $CCFLAGS, $CXX, $CXXCOM, $E SCAPE, $LINK, $LINKCOM, | Uses: $AR, $ARCOM, $ARFLAGS, $CC, $CCCOM, $CCFLAGS, $CXX, $CXXCOM, $E SCAPE, $LINK, $LINKCOM, | |||
$PLATFORM, $PRINT_CMD_LINE_FUNC, $PROGSUFFIX, $RANLIB, $RANLIBCOM, $S HCCCOM, $SHCXXCOM, $SHLINK, | $PLATFORM, $PRINT_CMD_LINE_FUNC, $PROGSUFFIX, $RANLIB, $RANLIBCOM, $S HCCCOM, $SHCXXCOM, $SHLINK, | |||
$SHLINKCOM. | $SHLINKCOM. | |||
packaging | packaging | |||
Sets construction variables for the Package Builder. If this tool is enabled, the --package-type | Sets construction variables for the Package Builder. If this tool is enabled, the --package-type | |||
command-line option is also enabled. | command-line option is also enabled. | |||
skipping to change at line 1734 | skipping to change at line 1759 | |||
Uses: $PDFLATEXCOMSTR, $PDFTEXCOMSTR. | Uses: $PDFLATEXCOMSTR, $PDFTEXCOMSTR. | |||
python | python | |||
Loads the Python source scanner into the invoking environment. When l oaded, the scanner will attempt | Loads the Python source scanner into the invoking environment. When l oaded, the scanner will attempt | |||
to find implicit dependencies for any Python source files in the list of sources provided to an | to find implicit dependencies for any Python source files in the list of sources provided to an | |||
Action that uses this environment. | Action that uses this environment. | |||
Available since scons 4.0.. | Available since scons 4.0.. | |||
qt | qt | |||
Sets construction variables for building Qt applications. | Sets construction variables for building Qt3 applications. | |||
Note | ||||
This tool is only suitable for building targeted to Qt3, which is | ||||
obsolete (the tool is | ||||
deprecated since 4.3). There are contributed tools for Qt4 and Qt | ||||
5, see | ||||
https://github.com/SCons/scons-contrib[1]. Qt4 has also passed en | ||||
d of life for standard support | ||||
(in Dec 2015). | ||||
Note paths for these construction variables are assembled using the o | ||||
s.path.join method so they will | ||||
have the appropriate separator at runtime, but are listed here in the | ||||
various entries only with the | ||||
'/' separator for simplicity. | ||||
In addition, the construction variables $CPPPATH, $LIBPATH and $LIBS | ||||
may be modified and the | ||||
variables $PROGEMITTER, $SHLIBEMITTER and $LIBEMITTER are modified. B | ||||
ecause the build-performance is | ||||
affected when using this tool, you have to explicitly specify it at E | ||||
nvironment creation: | ||||
Environment(tools=['default','qt']) | ||||
The qt tool supports the following operations: | ||||
Automatic moc file generation from header files. You do not have to | ||||
specify moc files explicitly, | ||||
the tool does it for you. However, there are a few preconditions to d | ||||
o so: Your header file must have | ||||
the same filebase as your implementation file and must stay in the sa | ||||
me directory. It must have one | ||||
of the suffixes .h, .hpp, .H, .hxx, .hh. You can turn off automatic m | ||||
oc file generation by setting | ||||
$QT_AUTOSCAN to False. See also the corresponding Moc Builder. | ||||
Automatic moc file generation from C++ files. As described in the Qt | ||||
documentation, include the moc | ||||
file at the end of the C++ file. Note that you have to include the fi | ||||
le, which is generated by the | ||||
transformation ${QT_MOCCXXPREFIX}<basename>${QT_MOCCXXSUFFIX}, by def | ||||
ault <basename>.mo. A warning is | ||||
generated after building the moc file if you do not include the corre | ||||
ct file. If you are using | ||||
VariantDir, you may need to specify duplicate=True. You can turn off | ||||
automatic moc file generation by | ||||
setting $QT_AUTOSCAN to False. See also the corresponding Moc Builder | ||||
. | ||||
Automatic handling of .ui files. The implementation files generated | ||||
from .ui files are handled much | ||||
the same as yacc or lex files. Each .ui file given as a source of Pro | ||||
gram, Library or SharedLibrary | ||||
will generate three files: the declaration file, the implementation f | ||||
ile and a moc file. Because | ||||
there are also generated headers, you may need to specify duplicate=T | ||||
rue in calls to VariantDir. See | ||||
also the corresponding Uic Builder. | ||||
Sets: $QTDIR, $QT_AUTOSCAN, $QT_BINPATH, $QT_CPPPATH, $QT_LIB, $QT_LI BPATH, $QT_MOC, | Sets: $QTDIR, $QT_AUTOSCAN, $QT_BINPATH, $QT_CPPPATH, $QT_LIB, $QT_LI BPATH, $QT_MOC, | |||
$QT_MOCCXXPREFIX, $QT_MOCCXXSUFFIX, $QT_MOCFROMCXXCOM, $QT_MOCFROMCXX FLAGS, $QT_MOCFROMHCOM, | $QT_MOCCXXPREFIX, $QT_MOCCXXSUFFIX, $QT_MOCFROMCXXCOM, $QT_MOCFROMCXX FLAGS, $QT_MOCFROMHCOM, | |||
$QT_MOCFROMHFLAGS, $QT_MOCHPREFIX, $QT_MOCHSUFFIX, $QT_UIC, $QT_UICCO M, $QT_UICDECLFLAGS, | $QT_MOCFROMHFLAGS, $QT_MOCHPREFIX, $QT_MOCHSUFFIX, $QT_UIC, $QT_UICCO M, $QT_UICDECLFLAGS, | |||
$QT_UICDECLPREFIX, $QT_UICDECLSUFFIX, $QT_UICIMPLFLAGS, $QT_UICIMPLPR EFIX, $QT_UICIMPLSUFFIX, | $QT_UICDECLPREFIX, $QT_UICDECLSUFFIX, $QT_UICIMPLFLAGS, $QT_UICIMPLPR EFIX, $QT_UICIMPLSUFFIX, | |||
$QT_UISUFFIX. | $QT_UISUFFIX. | |||
Uses: $QTDIR. | ||||
rmic | rmic | |||
Sets construction variables for the rmic utility. | Sets construction variables for the rmic utility. | |||
Sets: $JAVACLASSSUFFIX, $RMIC, $RMICCOM, $RMICFLAGS. | Sets: $JAVACLASSSUFFIX, $RMIC, $RMICCOM, $RMICFLAGS. | |||
Uses: $RMICCOMSTR. | Uses: $RMICCOMSTR. | |||
rpcgen | rpcgen | |||
Sets construction variables for building with RPCGEN. | Sets construction variables for building with RPCGEN. | |||
skipping to change at line 2142 | skipping to change at line 2205 | |||
Command(), env.Command() | Command(), env.Command() | |||
The Command "Builder" is actually a function that looks like a Builde r, but takes a required third | The Command "Builder" is actually a function that looks like a Builde r, but takes a required third | |||
argument, which is the action to take to construct the target from th e source, used for "one-off" | argument, which is the action to take to construct the target from th e source, used for "one-off" | |||
builds where a full builder is not needed. Thus it does not follow th e builder calling rules | builds where a full builder is not needed. Thus it does not follow th e builder calling rules | |||
described at the start of this section. See instead the Command funct ion description for the calling | described at the start of this section. See instead the Command funct ion description for the calling | |||
syntax and details. | syntax and details. | |||
CompilationDatabase(), env.CompilationDatabase() | CompilationDatabase(), env.CompilationDatabase() | |||
CompilationDatabase is a special builder which adds a target to creat e a JSON formatted compilation | CompilationDatabase is a special builder which adds a target to creat e a JSON formatted compilation | |||
database compatible with clang tooling (see the LLVM specification[1] ). This database is suitable for | database compatible with clang tooling (see the LLVM specification[2] ). This database is suitable for | |||
consumption by various tools and editors who can use it to obtain bui ld and dependency information | consumption by various tools and editors who can use it to obtain bui ld and dependency information | |||
which otherwise would be internal to SCons. The builder does not requ ire any source files to be | which otherwise would be internal to SCons. The builder does not requ ire any source files to be | |||
specified, rather it arranges to emit information about all of the C, C++ and assembler source/output | specified, rather it arranges to emit information about all of the C, C++ and assembler source/output | |||
pairs identified in the build that are not excluded by the optional f ilter | pairs identified in the build that are not excluded by the optional f ilter | |||
$COMPILATIONDB_PATH_FILTER. The target is subject to the usual SCons target selection rules. | $COMPILATIONDB_PATH_FILTER. The target is subject to the usual SCons target selection rules. | |||
If called with no arguments, the builder will default to a target nam e of compile_commands.json. | If called with no arguments, the builder will default to a target nam e of compile_commands.json. | |||
If called with a single positional argument, scons will "deduce" the target name from that source | If called with a single positional argument, scons will "deduce" the target name from that source | |||
argument, giving it the same name, and then ignore the source. This i s the usual way to call the | argument, giving it the same name, and then ignore the source. This i s the usual way to call the | |||
skipping to change at line 2455 | skipping to change at line 2518 | |||
# builds include/package_foo.h and include/package_bar.h | # builds include/package_foo.h and include/package_bar.h | |||
env.JavaH(target="include", source=["package/foo.class", "package /bar.class"]) | env.JavaH(target="include", source=["package/foo.class", "package /bar.class"]) | |||
# builds export/foo.h and export/bar.h | # builds export/foo.h and export/bar.h | |||
env.JavaH( | env.JavaH( | |||
target="export", | target="export", | |||
source=["classes/foo.class", "classes/bar.class"], | source=["classes/foo.class", "classes/bar.class"], | |||
JAVACLASSDIR="classes", | JAVACLASSDIR="classes", | |||
) | ) | |||
Note | ||||
Java versions starting with 10.0 no longer use the javah command | ||||
for generating JNI | ||||
headers/sources, and indeed have removed the command entirely (se | ||||
e Java Enhancement Proposal JEP | ||||
313[3]), making this tool harder to use for that purpose. SCons | ||||
may autodiscover a javah | ||||
belonging to an older release if there are multiple Java versions | ||||
on the system, which will lead | ||||
to incorrect results. To use with a newer Java, override the defa | ||||
ult values of $JAVAH (to contain | ||||
the path to the javac) and $JAVAHFLAGS (to contain at least a -h | ||||
flag) and note that generating | ||||
headers with javac requires supplying source .java files only, no | ||||
t .class files. | ||||
Library(), env.Library() | Library(), env.Library() | |||
A synonym for the StaticLibrary builder method. | A synonym for the StaticLibrary builder method. | |||
LoadableModule(), env.LoadableModule() | LoadableModule(), env.LoadableModule() | |||
On most systems, this is the same as SharedLibrary. On Mac OS X (Darw in) platforms, this creates a | On most systems, this is the same as SharedLibrary. On Mac OS X (Darw in) platforms, this creates a | |||
loadable module bundle. | loadable module bundle. | |||
M4(), env.M4() | M4(), env.M4() | |||
Builds an output file from an M4 input file. This uses a default $M4F LAGS value of -E, which | Builds an output file from an M4 input file. This uses a default $M4F LAGS value of -E, which | |||
considers all warnings to be fatal and stops on the first warning whe n using the GNU version of m4. | considers all warnings to be fatal and stops on the first warning whe n using the GNU version of m4. | |||
Example: | Example: | |||
env.M4(target = 'foo.c', source = 'foo.c.m4') | env.M4(target = 'foo.c', source = 'foo.c.m4') | |||
Moc(), env.Moc() | Moc(), env.Moc() | |||
Builds an output file from a moc input file. Moc input files are eith | Builds an output file from a moc input file. moc input files are eit | |||
er header files or cxx files. | her header files or C++ files. | |||
This builder is only available after using the tool 'qt'. See the $QT | This builder is only available after using the tool qt. See the $QTDI | |||
DIR variable for more | R variable for more information. | |||
information. Example: | Example: | |||
env.Moc('foo.h') # generates moc_foo.cc | env.Moc('foo.h') # generates moc_foo.cc | |||
env.Moc('foo.cpp') # generates foo.moc | env.Moc('foo.cpp') # generates foo.moc | |||
MOFiles(), env.MOFiles() | MOFiles(), env.MOFiles() | |||
This builder belongs to msgfmt tool. The builder compiles PO files to MO files. | This builder belongs to msgfmt tool. The builder compiles PO files to MO files. | |||
Example 1. Create pl.mo and en.mo by compiling pl.po and en.po: | Example 1. Create pl.mo and en.mo by compiling pl.po and en.po: | |||
# ... | # ... | |||
env.MOFiles(['pl', 'en']) | env.MOFiles(['pl', 'en']) | |||
Example 2. Compile files for languages defined in LINGUAS file: | Example 2. Compile files for languages defined in LINGUAS file: | |||
skipping to change at line 2784 | skipping to change at line 2856 | |||
This is an experimental feature. To enable it you must use one of the following methods | This is an experimental feature. To enable it you must use one of the following methods | |||
# On the command line | # On the command line | |||
--experimental=ninja | --experimental=ninja | |||
# Or in your SConstruct | # Or in your SConstruct | |||
SetOption('experimental', 'ninja') | SetOption('experimental', 'ninja') | |||
This functionality is subject to change and/or removal without de precation cycle. | This functionality is subject to change and/or removal without de precation cycle. | |||
To use this tool you must install pypi's ninja package[2]. This c an be done via pip install ninja | To use this tool you must install pypi's ninja package[4]. This c an be done via pip install ninja | |||
If called with no arguments, the builder will default to a target nam e of ninja.build. | If called with no arguments, the builder will default to a target nam e of ninja.build. | |||
If called with a single positional argument, scons will "deduce" the target name from that source | If called with a single positional argument, scons will "deduce" the target name from that source | |||
argument, giving it the same name, and then ignore the source. This i s the usual way to call the | argument, giving it the same name, and then ignore the source. This i s the usual way to call the | |||
builder if a non-default target name is wanted. | builder if a non-default target name is wanted. | |||
If called with either the target= or source= keyword arguments, the v alue of the argument is taken as | If called with either the target= or source= keyword arguments, the v alue of the argument is taken as | |||
the target name. If called with both, the target= value is used and s ource= is ignored. If called | the target name. If called with both, the target= value is used and s ource= is ignored. If called | |||
with multiple sources, the source list will be ignored, since there i s no way to deduce what the | with multiple sources, the source list will be ignored, since there i s no way to deduce what the | |||
intent was; in this case the default target name will be used. | intent was; in this case the default target name will be used. | |||
skipping to change at line 3558 | skipping to change at line 3630 | |||
Builds a Windows type library (.tlb) file from an input IDL file (.id l). In addition, it will build | Builds a Windows type library (.tlb) file from an input IDL file (.id l). In addition, it will build | |||
the associated interface stub and proxy source files, naming them acc ording to the base name of the | the associated interface stub and proxy source files, naming them acc ording to the base name of the | |||
.idl file. For example, | .idl file. For example, | |||
env.TypeLibrary(source="foo.idl") | env.TypeLibrary(source="foo.idl") | |||
Will create foo.tlb, foo.h, foo_i.c, foo_p.c and foo_data.c files. | Will create foo.tlb, foo.h, foo_i.c, foo_p.c and foo_data.c files. | |||
Uic(), env.Uic() | Uic(), env.Uic() | |||
Builds a header file, an implementation file and a moc file from an u i file. and returns the | Builds a header file, an implementation file and a moc file from an u i file. and returns the | |||
corresponding nodes in the above order. This builder is only availabl | corresponding nodes in the that order. This builder is only available | |||
e after using the tool 'qt'. | after using the tool qt. Note: | |||
Note: you can specify .ui files directly as source files to the Progr | you can specify .ui files directly as source files to the Program, Li | |||
am, Library and SharedLibrary | brary and SharedLibrary builders | |||
builders without using this builder. Using this builder lets you over | without using this builder. Using this builder lets you override the | |||
ride the standard naming | standard naming conventions (be | |||
conventions (be careful: prefixes are always prepended to names of bu | careful: prefixes are always prepended to names of built files; if yo | |||
ilt files; if you don't want | u don't want prefixes, you may | |||
prefixes, you may set them to ``). See the $QTDIR variable for more i | set them to ``). See the $QTDIR variable for more information. Exampl | |||
nformation. Example: | e: | |||
env.Uic('foo.ui') # -> ['foo.h', 'uic_foo.cc', 'moc_foo.cc'] | env.Uic('foo.ui') # -> ['foo.h', 'uic_foo.cc', 'moc_foo.cc'] | |||
env.Uic(target = Split('include/foo.h gen/uicfoo.cc gen/mocfoo.cc | env.Uic( | |||
'), | target=Split('include/foo.h gen/uicfoo.cc gen/mocfoo.cc'), | |||
source = 'foo.ui') # -> ['include/foo.h', 'gen/uicfoo.cc' | source='foo.ui' | |||
, 'gen/mocfoo.cc'] | ) # -> ['include/foo.h', 'gen/uicfoo.cc', 'gen/mocfoo.cc'] | |||
Zip(), env.Zip() | Zip(), env.Zip() | |||
Builds a zip archive of the specified files and/or directories. Unlik e most builder methods, the Zip | Builds a zip archive of the specified files and/or directories. Unlik e most builder methods, the Zip | |||
builder method may be called multiple times for a given target; each additional call adds to the list | builder method may be called multiple times for a given target; each additional call adds to the list | |||
of entries that will be built into the archive. Any source directorie s will be scanned for changes to | of entries that will be built into the archive. Any source directorie s will be scanned for changes to | |||
any on-disk files, regardless of whether or not scons knows about the m from other Builder or function | any on-disk files, regardless of whether or not scons knows about the m from other Builder or function | |||
calls. | calls. | |||
env.Zip('src.zip', 'src') | env.Zip('src.zip', 'src') | |||
skipping to change at line 3876 | skipping to change at line 3950 | |||
CPPDEFINES will expand to -DFOO -DBAR=1 -DOTHER=2 -DEXTRA=arg | CPPDEFINES will expand to -DFOO -DBAR=1 -DOTHER=2 -DEXTRA=arg | |||
scons: `.' is up to date. | scons: `.' is up to date. | |||
Adding a string val to a dictonary construction variable will enter v al as the key in the dict, and | Adding a string val to a dictonary construction variable will enter v al as the key in the dict, and | |||
None as its value. Using a tuple type to supply a key + value only wo rks for the special case of | None as its value. Using a tuple type to supply a key + value only wo rks for the special case of | |||
$CPPDEFINES described above. | $CPPDEFINES described above. | |||
Although most combinations of types work without needing to know the details, some combinations do | Although most combinations of types work without needing to know the details, some combinations do | |||
not make sense and a Python exception will be raised. | not make sense and a Python exception will be raised. | |||
When using env.Append to modify construction variables which are path | When using env.Append to modify construction variables which are path | |||
specifications (normally, those | specifications (conventionally, | |||
names which end in PATH), it is recommended to add the values as a li | the names of such end in PATH), it is recommended to add the values a | |||
st of strings, even if there is | s a list of strings, even if | |||
only a single string to add. The same goes for adding library names t | there is only a single string to add. The same goes for adding librar | |||
o $LIBS. | y names to $LIBS. | |||
env.Append(CPPPATH=["#/include"]) | env.Append(CPPPATH=["#/include"]) | |||
See also env.AppendUnique, env.Prepend and env.PrependUnique. | See also env.AppendUnique, env.Prepend and env.PrependUnique. | |||
env.AppendENVPath(name, newpath, [envname, sep, delete_existing=False]) | env.AppendENVPath(name, newpath, [envname, sep, delete_existing=False]) | |||
Append new path elements to the given path in the specified external environment ($ENV by default). | Append new path elements to the given path in the specified external environment ($ENV by default). | |||
This will only add any particular path once (leaving the last one it encounters and ignoring the | This will only add any particular path once (leaving the last one it encounters and ignoring the | |||
rest, to preserve path order), and to help assure this, will normaliz e all paths (using | rest, to preserve path order), and to help assure this, will normaliz e all paths (using | |||
os.path.normpath and os.path.normcase). This can also handle the case where the given old path | os.path.normpath and os.path.normcase). This can also handle the case where the given old path | |||
skipping to change at line 4882 | skipping to change at line 4956 | |||
Any other strings not associated with options are assumed to be the n ames of libraries and added to | Any other strings not associated with options are assumed to be the n ames of libraries and added to | |||
the $LIBS construction variable. | the $LIBS construction variable. | |||
Examples (all of which produce the same result): | Examples (all of which produce the same result): | |||
dict = env.ParseFlags('-O2 -Dfoo -Dbar=1') | dict = env.ParseFlags('-O2 -Dfoo -Dbar=1') | |||
dict = env.ParseFlags('-O2', '-Dfoo', '-Dbar=1') | dict = env.ParseFlags('-O2', '-Dfoo', '-Dbar=1') | |||
dict = env.ParseFlags(['-O2', '-Dfoo -Dbar=1']) | dict = env.ParseFlags(['-O2', '-Dfoo -Dbar=1']) | |||
dict = env.ParseFlags('-O2', '!echo -Dfoo -Dbar=1') | dict = env.ParseFlags('-O2', '!echo -Dfoo -Dbar=1') | |||
Platform(string) | Platform(plat), env.Platform(plat) | |||
The Platform form returns a callable object that can be used to initi | When called as a global function, returns a callable platform object | |||
alize a construction environment | selected by plat (defaults to | |||
using the platform keyword of the Environment function. | the detected platform for the current system) that can be used to ini | |||
tialize a construction | ||||
environment by passing it as the platform keyword argument to the Env | ||||
ironment function. | ||||
Example: | Example: | |||
env = Environment(platform=Platform('win32')) | env = Environment(platform=Platform('win32')) | |||
The env.Platform form applies the callable object for the specified p | When called as a method of an environment, calls the platform object | |||
latform string to the | indicated by plat to update that | |||
environment through which the method was called. | environment. | |||
env.Platform('posix') | env.Platform('posix') | |||
Note that the win32 platform adds the SystemDrive and SystemRoot vari | See the manpage section "Construction Environments" for more details. | |||
ables from the user's external | ||||
environment to the construction environment's $ENV dictionary. This i | ||||
s so that any executed commands | ||||
that use sockets to connect with other systems (such as fetching sour | ||||
ce files from external CVS | ||||
repository specifications like :pserver:anonymous@cvs.sourceforge.net | ||||
:/cvsroot/scons) will work on | ||||
Windows systems. | ||||
Precious(target, ...), env.Precious(target, ...) | Precious(target, ...), env.Precious(target, ...) | |||
Marks each given target as precious so it is not deleted before it is rebuilt. Normally scons deletes | Marks each given target as precious so it is not deleted before it is rebuilt. Normally scons deletes | |||
a target before building it. Multiple targets can be passed in to a s ingle call to Precious. | a target before building it. Multiple targets can be passed in to a s ingle call to Precious. | |||
env.Prepend(key=val, [...]) | env.Prepend(key=val, [...]) | |||
Prepend values to construction variables in the current construction environment, Works like | Prepend values to construction variables in the current construction environment, Works like | |||
env.Append (see for details), except that values are added to the fro nt, rather than the end, of any | env.Append (see for details), except that values are added to the fro nt, rather than the end, of any | |||
existing value of the construction variable | existing value of the construction variable | |||
skipping to change at line 5316 | skipping to change at line 5387 | |||
├────────────────────────┼───────────────────────────┼─────────────── ───────────────┤ | ├────────────────────────┼───────────────────────────┼─────────────── ───────────────┤ | |||
│md5_chunksize │ --md5-chunksize │ │ | │md5_chunksize │ --md5-chunksize │ │ | |||
├────────────────────────┼───────────────────────────┼─────────────── ───────────────┤ | ├────────────────────────┼───────────────────────────┼─────────────── ───────────────┤ | |||
│no_exec │ -n, │ │ | │no_exec │ -n, │ │ | |||
│ │ --no-exec, │ │ | │ │ --no-exec, │ │ | |||
│ │ --just-print, │ │ | │ │ --just-print, │ │ | |||
│ │ --dry-run, │ │ | │ │ --dry-run, │ │ | |||
│ │ --recon │ │ | │ │ --recon │ │ | |||
├────────────────────────┼───────────────────────────┼─────────────── ───────────────┤ | ├────────────────────────┼───────────────────────────┼─────────────── ───────────────┤ | |||
│no_progress │ -Q │ See │ | │no_progress │ -Q │ See │ | |||
│ │ │ [3] │ | │ │ │ [5] │ | |||
├────────────────────────┼───────────────────────────┼─────────────── ───────────────┤ | ├────────────────────────┼───────────────────────────┼─────────────── ───────────────┤ | |||
│num_jobs │ -j, --jobs │ │ | │num_jobs │ -j, --jobs │ │ | |||
├────────────────────────┼───────────────────────────┼─────────────── ───────────────┤ | ├────────────────────────┼───────────────────────────┼─────────────── ───────────────┤ | |||
│random │ --random │ │ | │random │ --random │ │ | |||
├────────────────────────┼───────────────────────────┼─────────────── ───────────────┤ | ├────────────────────────┼───────────────────────────┼─────────────── ───────────────┤ | |||
│silent │ -s, │ │ | │silent │ -s, │ │ | |||
│ │ --silent, │ │ | │ │ --silent, │ │ | |||
│ │ --quiet │ │ | │ │ --quiet │ │ | |||
├────────────────────────┼───────────────────────────┼─────────────── ───────────────┤ | ├────────────────────────┼───────────────────────────┼─────────────── ───────────────┤ | |||
│stack_size │ --stack-size │ │ | │stack_size │ --stack-size │ │ | |||
skipping to change at line 5360 | skipping to change at line 5431 | |||
target is not automatically removed when the target is removed by the -c option. (Note, however, that | target is not automatically removed when the target is removed by the -c option. (Note, however, that | |||
the side_effect might be removed as part of cleaning the directory in which it lives.) If you want to | the side_effect might be removed as part of cleaning the directory in which it lives.) If you want to | |||
make sure the side_effect is cleaned whenever a specific target is cl eaned, you must specify this | make sure the side_effect is cleaned whenever a specific target is cl eaned, you must specify this | |||
explicitly with the Clean or env.Clean function. | explicitly with the Clean or env.Clean function. | |||
This function returns the list of side effect Node objects that were successfully added. If the list | This function returns the list of side effect Node objects that were successfully added. If the list | |||
of side effects contained any side effects that had already been adde d, they are not added and | of side effects contained any side effects that had already been adde d, they are not added and | |||
included in the returned list. | included in the returned list. | |||
Split(arg), env.Split(arg) | Split(arg), env.Split(arg) | |||
Returns a list of file names or other objects. If arg is a string, it | If arg is a string, splits on whitespace and returns a list of string | |||
will be split on strings of | s without whitespace. This mode | |||
white-space characters within the string, making it easier to write l | is the most common case, and can be used to split a list of filenames | |||
ong lists of file names. If arg | (for example) rather than | |||
is already a list, the list will be returned untouched. If arg is any | having to type them as a list of individually quoted words. If arg is | |||
other type of object, it will | a list or tuple returns the | |||
be returned as a list containing just the object. | list or tuple unchanged. If arg is any other type of object, returns | |||
a list containing just the | ||||
object. These non-string cases do not actually do any spliting, but a | ||||
llow an argument variable to be | ||||
passed to Split without having to first check its type. | ||||
Example: | Example: | |||
files = Split("f1.c f2.c f3.c") | files = Split("f1.c f2.c f3.c") | |||
files = env.Split("f4.c f5.c f6.c") | files = env.Split("f4.c f5.c f6.c") | |||
files = Split(""" | files = Split(""" | |||
f7.c | f7.c | |||
f8.c | f8.c | |||
f9.c | f9.c | |||
""") | """) | |||
env.subst(input, [raw, target, source, conv]) | env.subst(input, [raw, target, source, conv]) | |||
Performs construction variable interpolation on the specified string or sequence argument input. | Performs construction variable interpolation on input, which can be a string or a sequence. | |||
By default, leading or trailing white space will be removed from the result. and all sequences of | By default, leading or trailing white space will be removed from the result, and all sequences of | |||
white space will be compressed to a single space character. Additiona lly, any $( and $) character | white space will be compressed to a single space character. Additiona lly, any $( and $) character | |||
sequences will be stripped from the returned string, The optional raw argument may be set to 1 if you | sequences will be stripped from the returned string, The optional raw argument may be set to 1 if you | |||
want to preserve white space and $(-$) sequences. The raw argument ma y be set to 2 if you want to | want to preserve white space and $(-$) sequences. The raw argument ma y be set to 2 if you want to | |||
strip all characters between any $( and $) pairs (as is done for sign | additionally discard all characters between any $( and $) pairs (as i | |||
ature calculation). | s done for signature | |||
calculation). | ||||
If the input is a sequence (list or tuple), the individual elements o f the sequence will be expanded, | If the input is a sequence (list or tuple), the individual elements o f the sequence will be expanded, | |||
and the results will be returned as a list. | and the results will be returned as a list. | |||
The optional target and source keyword arguments must be set to lists of target and source nodes, | The optional target and source keyword arguments must be set to lists of target and source nodes, | |||
respectively, if you want the $TARGET, $TARGETS, $SOURCE and $SOURCES to be available for expansion. | respectively, if you want the $TARGET, $TARGETS, $SOURCE and $SOURCES to be available for expansion. | |||
This is usually necessary if you are calling env.subst from within a Python function used as an SCons | This is usually necessary if you are calling env.subst from within a Python function used as an SCons | |||
action. | action. | |||
Returned string values or sequence elements are converted to their st ring representation by default. | Returned string values or sequence elements are converted to their st ring representation by default. | |||
The optional conv argument may specify a conversion function that wil l be used in place of the | The optional conv argument may specify a conversion function that wil l be used in place of the | |||
default. For example, if you want Python objects (including SCons Nod es) to be returned as Python | default. For example, if you want Python objects (including SCons Nod es) to be returned as Python | |||
objects, you can use the Python Λ idiom to pass in an unnamed functio | objects, you can use a Python lambda expression to pass in an unnamed | |||
n that simply returns its | function that simply returns | |||
unconverted argument. | its unconverted argument. | |||
Example: | Example: | |||
print(env.subst("The C compiler is: $CC")) | print(env.subst("The C compiler is: $CC")) | |||
def compile(target, source, env): | def compile(target, source, env): | |||
sourceDir = env.subst( | sourceDir = env.subst( | |||
"${SOURCE.srcdir}", | "${SOURCE.srcdir}", | |||
target=target, | target=target, | |||
source=source | source=source | |||
skipping to change at line 6876 | skipping to change at line 6950 | |||
GSCOMSTR | GSCOMSTR | |||
The string displayed when Ghostscript is called for the conversion pr ocess. If this is not set (the | The string displayed when Ghostscript is called for the conversion pr ocess. If this is not set (the | |||
default), then $GSCOM (the command line) is displayed. | default), then $GSCOM (the command line) is displayed. | |||
GSFLAGS | GSFLAGS | |||
General options passed to the Ghostscript program, when converting Po stScript to PDF files for | General options passed to the Ghostscript program, when converting Po stScript to PDF files for | |||
example. Its default value is “-dNOPAUSE -dBATCH -sDEVICE=pdfwrite” | example. Its default value is “-dNOPAUSE -dBATCH -sDEVICE=pdfwrite” | |||
HOST_ARCH | HOST_ARCH | |||
The name of the host hardware architecture used to create the Environ | The name of the host hardware architecture used to create this constr | |||
ment. If a platform is specified | uction environment. The platform | |||
when creating the Environment, then that Platform's logic will handle | code sets this when initializing (see $PLATFORM and the platform argu | |||
setting this value. This value | ment to Environment). Note the | |||
is immutable, and should not be changed by the user after the Environ | detected name of the architecture may not be identical to that return | |||
ment is initialized. Currently | ed by the Python | |||
only set for Win32. | platform.machine method. | |||
Sets the host architecture for the Visual C++ compiler. If not set, d | On the win32 platform, if the Microsoft Visual C++ compiler is availa | |||
efault to the detected host | ble, msvc tool setup is done | |||
architecture: note that this may depend on the python you are using. | using $HOST_ARCH and $TARGET_ARCH. Changing the values at any later t | |||
This variable must be passed as | ime will not cause the tool to | |||
an argument to the Environment() constructor; setting it later has no | be reinitialized. Valid host arch values are x86 and arm for 32-bit h | |||
effect. | osts and amd64 and x86_64 for | |||
64-bit hosts. | ||||
Valid values are the same as for $TARGET_ARCH. | ||||
This is currently only used on Windows, but in the future it may be u | Should be considered immutable. $HOST_ARCH is not currently used by | |||
sed on other OSes as well. | other platforms, but the option | |||
is reserved to do so in future | ||||
HOST_OS | HOST_OS | |||
The name of the host operating system used to create the Environment. | The name of the host operating system for the platform used to create | |||
If a platform is specified when | this construction environment. | |||
creating the Environment, then that Platform's logic will handle sett | The platform code sets this when initializing (see $PLATFORM and the | |||
ing this value. This value is | platform argument to | |||
immutable, and should not be changed by the user after the Environmen | Environment). | |||
t is initialized. Currently only | ||||
set for Win32. | Should be considered immutable. $HOST_OS is not currently used by SC | |||
ons, but the option is reserved | ||||
to do so in future | ||||
IDLSUFFIXES | IDLSUFFIXES | |||
The list of suffixes of files that will be scanned for IDL implicit d ependencies (#include or import | The list of suffixes of files that will be scanned for IDL implicit d ependencies (#include or import | |||
lines). The default list is: | lines). The default list is: | |||
[".idl", ".IDL"] | [".idl", ".IDL"] | |||
IMPLIBNOVERSIONSYMLINKS | IMPLIBNOVERSIONSYMLINKS | |||
Used to override $SHLIBNOVERSIONSYMLINKS/$LDMODULENOVERSIONSYMLINKS w hen creating versioned import | Used to override $SHLIBNOVERSIONSYMLINKS/$LDMODULENOVERSIONSYMLINKS w hen creating versioned import | |||
library for a shared library/loadable module. If not defined, then | library for a shared library/loadable module. If not defined, then | |||
skipping to change at line 7081 | skipping to change at line 7157 | |||
names will be separated by the operating system's path separate chara cter (: on UNIX/Linux/POSIX, ; | names will be separated by the operating system's path separate chara cter (: on UNIX/Linux/POSIX, ; | |||
on Windows). | on Windows). | |||
Note that this currently just adds the specified directory via the -s ourcepath option. SCons does | Note that this currently just adds the specified directory via the -s ourcepath option. SCons does | |||
not currently search the $JAVASOURCEPATH directories for dependency . java files. | not currently search the $JAVASOURCEPATH directories for dependency . java files. | |||
JAVASUFFIX | JAVASUFFIX | |||
The suffix for Java files; .java by default. | The suffix for Java files; .java by default. | |||
JAVAVERSION | JAVAVERSION | |||
Specifies the Java version being used by the Java builder. This is no | Specifies the Java version being used by the Java builder. Set this t | |||
t currently used to select one | o specify the version of Java | |||
version of the Java compiler vs. another. Instead, you should set thi | targeted by the javac compiler. This is sometimes necessary because J | |||
s to specify the version of Java | ava 1.5 changed the file names | |||
supported by your javac compiler. The default is 1.4. | that are created for nested anonymous inner classes, which can cause | |||
a mismatch with the files that | ||||
This is sometimes necessary because Java 1.5 changed the file names t | SCons expects will be generated by the javac compiler. Setting $JAVAV | |||
hat are created for nested | ERSION to a version greater than | |||
anonymous inner classes, which can cause a mismatch with the files th | 1.4 makes SCons realize that a build with such a compiler is actually | |||
at SCons expects will be | up to date. The default is 1.4. | |||
generated by the javac compiler. Setting $JAVAVERSION to 1.5 (or 1.6, | ||||
as appropriate) can make SCons | While this is not primarily intended for selecting one version of the | |||
realize that a Java 1.5 or 1.6 build is actually up to date. | Java compiler vs. another, it | |||
does have that effect on the Windows platform. A more precise approac | ||||
h is to set $JAVAC (and related | ||||
construction variables for related utilities) to the path to the spec | ||||
ific Java compiler you want, if | ||||
that is not the default compiler. On non-Windows platforms, the alter | ||||
natives system may provide a way | ||||
to adjust the default Java compiler without having to specify explici | ||||
t paths. | ||||
LATEX | LATEX | |||
The LaTeX structured formatter and typesetter. | The LaTeX structured formatter and typesetter. | |||
LATEXCOM | LATEXCOM | |||
The command line used to call the LaTeX structured formatter and type setter. | The command line used to call the LaTeX structured formatter and type setter. | |||
LATEXCOMSTR | LATEXCOMSTR | |||
The string displayed when calling the LaTeX structured formatter and typesetter. If this is not set, | The string displayed when calling the LaTeX structured formatter and typesetter. If this is not set, | |||
then $LATEXCOM (the command line) is displayed. | then $LATEXCOM (the command line) is displayed. | |||
skipping to change at line 7290 | skipping to change at line 7369 | |||
win32, os2, etc.), but the value is overridden by individual tools (a r, mslib, sgiar, sunar, tlib, | win32, os2, etc.), but the value is overridden by individual tools (a r, mslib, sgiar, sunar, tlib, | |||
etc.) to reflect the names of the libraries they create. | etc.) to reflect the names of the libraries they create. | |||
LIBSUFFIXES | LIBSUFFIXES | |||
A list of all legal suffixes for library file names. When searching f or library dependencies, SCons | A list of all legal suffixes for library file names. When searching f or library dependencies, SCons | |||
will look for files with prefixes from the $LIBPREFIXES list, the bas e library name, and these | will look for files with prefixes from the $LIBPREFIXES list, the bas e library name, and these | |||
suffixes. | suffixes. | |||
LICENSE | LICENSE | |||
The abbreviated name, preferably the SPDX code, of the license under which this project is released | The abbreviated name, preferably the SPDX code, of the license under which this project is released | |||
(GPL-3.0, LGPL-2.1, BSD-2-Clause etc.). See http://www.opensource.org /licenses/alphabetical[4] for a | (GPL-3.0, LGPL-2.1, BSD-2-Clause etc.). See http://www.opensource.org /licenses/alphabetical[6] for a | |||
list of license names and SPDX codes. | list of license names and SPDX codes. | |||
See the Package builder. | See the Package builder. | |||
LINESEPARATOR | LINESEPARATOR | |||
The separator used by the Substfile and Textfile builders. This value is used between sources when | The separator used by the Substfile and Textfile builders. This value is used between sources when | |||
constructing the target. It defaults to the current system line separ ator. | constructing the target. It defaults to the current system line separ ator. | |||
LINGUAS_FILE | LINGUAS_FILE | |||
The $LINGUAS_FILE defines file(s) containing list of additional lingu as to be processed by POInit, | The $LINGUAS_FILE defines file(s) containing list of additional lingu as to be processed by POInit, | |||
skipping to change at line 7477 | skipping to change at line 7556 | |||
Valid values are '1' or '0' | Valid values are '1' or '0' | |||
MSVC_VERSION | MSVC_VERSION | |||
Sets the preferred version of Microsoft Visual C/C++ to use. | Sets the preferred version of Microsoft Visual C/C++ to use. | |||
If $MSVC_VERSION is not set, SCons will (by default) select the lates t version of Visual C/C++ | If $MSVC_VERSION is not set, SCons will (by default) select the lates t version of Visual C/C++ | |||
installed on your system. If the specified version isn't installed, t ool initialization will fail. | installed on your system. If the specified version isn't installed, t ool initialization will fail. | |||
This variable must be passed as an argument to the Environment constr uctor; setting it later has no | This variable must be passed as an argument to the Environment constr uctor; setting it later has no | |||
effect. | effect. | |||
Valid values for Windows are 14.2, 14.1, 14.1Exp, 14.0, 14.0Exp, 12.0 | Valid values for Windows are 14.3, 14.2, 14.1, 14.1Exp, 14.0, 14.0Exp | |||
, 12.0Exp, 11.0, 11.0Exp, 10.0, | , 12.0, 12.0Exp, 11.0, 11.0Exp, | |||
10.0Exp, 9.0, 9.0Exp, 8.0, 8.0Exp, 7.1, 7.0, and 6.0. Versions ending | 10.0, 10.0Exp, 9.0, 9.0Exp, 8.0, 8.0Exp, 7.1, 7.0, and 6.0. Versions | |||
in Exp refer to "Express" or | ending in Exp refer to "Express" | |||
"Express for Desktop" editions. | or "Express for Desktop" editions. | |||
MSVS | MSVS | |||
When the Microsoft Visual Studio tools are initialized, they set up t his dictionary with the | When the Microsoft Visual Studio tools are initialized, they set up t his dictionary with the | |||
following keys: | following keys: | |||
VERSION | VERSION | |||
the version of MSVS being used (can be set via $MSVS_VERSION) | the version of MSVS being used (can be set via $MSVS_VERSION) | |||
VERSIONS | VERSIONS | |||
the available versions of MSVS installed | the available versions of MSVS installed | |||
skipping to change at line 7673 | skipping to change at line 7752 | |||
NINJA_ENV_VAR_CACHE | NINJA_ENV_VAR_CACHE | |||
A string that sets the environment for any environment variables that differ between the OS | A string that sets the environment for any environment variables that differ between the OS | |||
environment and the SCons command ENV. It will be compatible with the default shell of the operating | environment and the SCons command ENV. It will be compatible with the default shell of the operating | |||
system. If not explicitly specified, SCons will generate this dynamic ally from the Environment()'s | system. If not explicitly specified, SCons will generate this dynamic ally from the Environment()'s | |||
'ENV' “env['ENV']” where those values differ from the existing shell. . | 'ENV' “env['ENV']” where those values differ from the existing shell. . | |||
NINJA_FILE_NAME | NINJA_FILE_NAME | |||
The filename for the generated Ninja build file defaults to ninja.bui ld | The filename for the generated Ninja build file defaults to ninja.bui ld | |||
NINJA_FORCE_SCONS_BUILD | ||||
When NINJA_FORCE_SCONS_BUILD is True, this will cause the build nodes | ||||
to callback to scons instead of | ||||
using ninja to build them. This is intended to be passed to the envir | ||||
onment on the builder | ||||
invocation. It is useful if you have a build node which does somethin | ||||
g which is not easily translated | ||||
into ninja. | ||||
NINJA_GENERATED_SOURCE_SUFFIXES | NINJA_GENERATED_SOURCE_SUFFIXES | |||
The list of source file suffixes which are generated by SCons build s teps. All source files which | The list of source file suffixes which are generated by SCons build s teps. All source files which | |||
match these suffixes will be added to the _generated_sources alias in the output ninja.build file. | match these suffixes will be added to the _generated_sources alias in the output ninja.build file. | |||
Then all other source files will be made to depend on this in the nin ja.build file, forcing the | Then all other source files will be made to depend on this in the nin ja.build file, forcing the | |||
generated sources to be built first. | generated sources to be built first. | |||
NINJA_MSVC_DEPS_PREFIX | NINJA_MSVC_DEPS_PREFIX | |||
This propagates directly into the generated ninja.build file. From Ni nja's docs “defines the string | This propagates directly into the generated ninja.build file. From Ni nja's docs “defines the string | |||
which should be stripped from msvc’s /showIncludes output” | which should be stripped from msvc’s /showIncludes output” | |||
skipping to change at line 7736 | skipping to change at line 7821 | |||
packager and should reflect changes in the packaging, not the underly ing project code itself. | packager and should reflect changes in the packaging, not the underly ing project code itself. | |||
See the Package builder. | See the Package builder. | |||
PCH | PCH | |||
The Microsoft Visual C++ precompiled header that will be used when co mpiling object files. This | The Microsoft Visual C++ precompiled header that will be used when co mpiling object files. This | |||
variable is ignored by tools other than Microsoft Visual C++. When th is variable is defined SCons | variable is ignored by tools other than Microsoft Visual C++. When th is variable is defined SCons | |||
will add options to the compiler command line to cause it to use the precompiled header, and will | will add options to the compiler command line to cause it to use the precompiled header, and will | |||
also set up the dependencies for the PCH file. Example: | also set up the dependencies for the PCH file. Example: | |||
env['PCH'] = 'StdAfx.pch' | env['PCH'] = File('StdAfx.pch') | |||
PCHCOM | PCHCOM | |||
The command line used by the PCH builder to generated a precompiled h eader. | The command line used by the PCH builder to generated a precompiled h eader. | |||
PCHCOMSTR | PCHCOMSTR | |||
The string displayed when generating a precompiled header. If this is not set, then $PCHCOM (the | The string displayed when generating a precompiled header. If this is not set, then $PCHCOM (the | |||
command line) is displayed. | command line) is displayed. | |||
PCHPDBFLAGS | PCHPDBFLAGS | |||
A construction variable that, when expanded, adds the /yD flag to the command line only if the $PDB | A construction variable that, when expanded, adds the /yD flag to the command line only if the $PDB | |||
skipping to change at line 7820 | skipping to change at line 7905 | |||
PKGCHK | PKGCHK | |||
On Solaris systems, the package-checking program that will be used (a long with $PKGINFO) to look for | On Solaris systems, the package-checking program that will be used (a long with $PKGINFO) to look for | |||
installed versions of the Sun PRO C++ compiler. The default is /usr/s bin/pgkchk. | installed versions of the Sun PRO C++ compiler. The default is /usr/s bin/pgkchk. | |||
PKGINFO | PKGINFO | |||
On Solaris systems, the package information program that will be used (along with $PKGCHK) to look | On Solaris systems, the package information program that will be used (along with $PKGCHK) to look | |||
for installed versions of the Sun PRO C++ compiler. The default is pk ginfo. | for installed versions of the Sun PRO C++ compiler. The default is pk ginfo. | |||
PLATFORM | PLATFORM | |||
The name of the platform used to create the Environment. If no platfo | The name of the platform used to create this construction environment | |||
rm is specified when the | . SCons sets this when | |||
Environment is created, scons autodetects the platform. | initializing the platform, which by default is auto-detected (see the | |||
platform argument to | ||||
Environment). | ||||
env = Environment(tools = []) | env = Environment(tools=[]) | |||
if env['PLATFORM'] == 'cygwin': | if env['PLATFORM'] == 'cygwin': | |||
Tool('mingw')(env) | Tool('mingw')(env) | |||
else: | else: | |||
Tool('msvc')(env) | Tool('msvc')(env) | |||
POAUTOINIT | POAUTOINIT | |||
The $POAUTOINIT variable, if set to True (on non-zero numeric value), let the msginit tool to | The $POAUTOINIT variable, if set to True (on non-zero numeric value), let the msginit tool to | |||
automatically initialize missing PO files with msginit(1). This appli es to both, POInit and POUpdate | automatically initialize missing PO files with msginit(1). This appli es to both, POInit and POUpdate | |||
builders (and others that use any of them). | builders (and others that use any of them). | |||
skipping to change at line 7910 | skipping to change at line 7996 | |||
PSPREFIX | PSPREFIX | |||
The prefix used for PostScript file names. | The prefix used for PostScript file names. | |||
PSSUFFIX | PSSUFFIX | |||
The prefix used for PostScript file names. | The prefix used for PostScript file names. | |||
QT_AUTOSCAN | QT_AUTOSCAN | |||
Turn off scanning for mocable files. Use the Moc Builder to explicitl y specify files to run moc on. | Turn off scanning for mocable files. Use the Moc Builder to explicitl y specify files to run moc on. | |||
QT_BINPATH | QT_BINPATH | |||
The path where the qt binaries are installed. The default value is '$ QTDIR/bin'. | The path where the Qt binaries are installed. The default value is '$ QTDIR/bin'. | |||
QT_CPPPATH | QT_CPPPATH | |||
The path where the qt header files are installed. The default value i s '$QTDIR/include'. Note: If you | The path where the Qt header files are installed. The default value i s '$QTDIR/include'. Note: If you | |||
set this variable to None, the tool won't change the $CPPPATH constru ction variable. | set this variable to None, the tool won't change the $CPPPATH constru ction variable. | |||
QT_DEBUG | QT_DEBUG | |||
Prints lots of debugging information while scanning for moc files. | Prints lots of debugging information while scanning for moc files. | |||
QT_LIB | QT_LIB | |||
Default value is 'qt'. You may want to set this to 'qt-mt'. Note: If you set this variable to None, | Default value is 'qt'. You may want to set this to 'qt-mt'. Note: If you set this variable to None, | |||
the tool won't change the $LIBS variable. | the tool won't change the $LIBS variable. | |||
QT_LIBPATH | QT_LIBPATH | |||
The path where the qt libraries are installed. The default value is ' $QTDIR/lib'. Note: If you set | The path where the Qt libraries are installed. The default value is ' $QTDIR/lib'. Note: If you set | |||
this variable to None, the tool won't change the $LIBPATH constructio n variable. | this variable to None, the tool won't change the $LIBPATH constructio n variable. | |||
QT_MOC | QT_MOC | |||
Default value is '$QT_BINPATH/moc'. | Default value is '$QT_BINPATH/moc'. | |||
QT_MOCCXXPREFIX | QT_MOCCXXPREFIX | |||
Default value is ''. Prefix for moc output files, when source is a cx x file. | Default value is ''. Prefix for moc output files when source is a C++ file. | |||
QT_MOCCXXSUFFIX | QT_MOCCXXSUFFIX | |||
Default value is '.moc'. Suffix for moc output files, when source is a cxx file. | Default value is '.moc'. Suffix for moc output files when source is a C++ file. | |||
QT_MOCFROMCXXCOM | QT_MOCFROMCXXCOM | |||
Command to generate a moc file from a cpp file. | Command to generate a moc file from a C++ file. | |||
QT_MOCFROMCXXCOMSTR | QT_MOCFROMCXXCOMSTR | |||
The string displayed when generating a moc file from a cpp file. If t his is not set, then | The string displayed when generating a moc file from a C++ file. If t his is not set, then | |||
$QT_MOCFROMCXXCOM (the command line) is displayed. | $QT_MOCFROMCXXCOM (the command line) is displayed. | |||
QT_MOCFROMCXXFLAGS | QT_MOCFROMCXXFLAGS | |||
Default value is '-i'. These flags are passed to moc, when moccing a C++ file. | Default value is '-i'. These flags are passed to moc when moccing a C ++ file. | |||
QT_MOCFROMHCOM | QT_MOCFROMHCOM | |||
Command to generate a moc file from a header. | Command to generate a moc file from a header. | |||
QT_MOCFROMHCOMSTR | QT_MOCFROMHCOMSTR | |||
The string displayed when generating a moc file from a cpp file. If t his is not set, then | The string displayed when generating a moc file from a C++ file. If t his is not set, then | |||
$QT_MOCFROMHCOM (the command line) is displayed. | $QT_MOCFROMHCOM (the command line) is displayed. | |||
QT_MOCFROMHFLAGS | QT_MOCFROMHFLAGS | |||
Default value is ''. These flags are passed to moc, when moccing a he ader file. | Default value is ''. These flags are passed to moc when moccing a hea der file. | |||
QT_MOCHPREFIX | QT_MOCHPREFIX | |||
Default value is 'moc_'. Prefix for moc output files, when source is a header. | Default value is 'moc_'. Prefix for moc output files when source is a header. | |||
QT_MOCHSUFFIX | QT_MOCHSUFFIX | |||
Default value is '$CXXFILESUFFIX'. Suffix for moc output files, when source is a header. | Default value is '$CXXFILESUFFIX'. Suffix for moc output files when s ource is a header. | |||
QT_UIC | QT_UIC | |||
Default value is '$QT_BINPATH/uic'. | Default value is '$QT_BINPATH/uic'. | |||
QT_UICCOM | QT_UICCOM | |||
Command to generate header files from .ui files. | Command to generate header files from .ui files. | |||
QT_UICCOMSTR | QT_UICCOMSTR | |||
The string displayed when generating header files from .ui files. If this is not set, then $QT_UICCOM | The string displayed when generating header files from .ui files. If this is not set, then $QT_UICCOM | |||
(the command line) is displayed. | (the command line) is displayed. | |||
QT_UICDECLFLAGS | QT_UICDECLFLAGS | |||
Default value is ''. These flags are passed to uic, when creating a a h file from a .ui file. | Default value is ''. These flags are passed to uic when creating a he ader file from a .ui file. | |||
QT_UICDECLPREFIX | QT_UICDECLPREFIX | |||
Default value is ''. Prefix for uic generated header files. | Default value is ''. Prefix for uic generated header files. | |||
QT_UICDECLSUFFIX | QT_UICDECLSUFFIX | |||
Default value is '.h'. Suffix for uic generated header files. | Default value is '.h'. Suffix for uic generated header files. | |||
QT_UICIMPLFLAGS | QT_UICIMPLFLAGS | |||
Default value is ''. These flags are passed to uic, when creating a c xx file from a .ui file. | Default value is ''. These flags are passed to uic when creating a C+ + file from a .ui file. | |||
QT_UICIMPLPREFIX | QT_UICIMPLPREFIX | |||
Default value is 'uic_'. Prefix for uic generated implementation file s. | Default value is 'uic_'. Prefix for uic generated implementation file s. | |||
QT_UICIMPLSUFFIX | QT_UICIMPLSUFFIX | |||
Default value is '$CXXFILESUFFIX'. Suffix for uic generated implement ation files. | Default value is '$CXXFILESUFFIX'. Suffix for uic generated implement ation files. | |||
QT_UISUFFIX | QT_UISUFFIX | |||
Default value is '.ui'. Suffix of designer input files. | Default value is '.ui'. Suffix of designer input files. | |||
QTDIR | QTDIR | |||
The qt tool tries to take this from os.environ. It also initializes a | The path to the Qt installation to build against. If not already set, | |||
ll QT_* construction variables | qt tool tries to obtain this | |||
listed below. (Note that all paths are constructed with python's os.p | from os.environ; if not found there, it tries to make a guess. | |||
ath.join() method, but are | ||||
listed here with the '/' separator for easier reading.) In addition, | ||||
the construction environment | ||||
variables $CPPPATH, $LIBPATH and $LIBS may be modified and the variab | ||||
les $PROGEMITTER, $SHLIBEMITTER | ||||
and $LIBEMITTER are modified. Because the build-performance is affect | ||||
ed when using this tool, you | ||||
have to explicitly specify it at Environment creation: | ||||
Environment(tools=['default','qt']) | ||||
The qt tool supports the following operations: | ||||
Automatic moc file generation from header files. You do not have to | ||||
specify moc files explicitly, | ||||
the tool does it for you. However, there are a few preconditions to d | ||||
o so: Your header file must have | ||||
the same filebase as your implementation file and must stay in the sa | ||||
me directory. It must have one | ||||
of the suffixes .h, .hpp, .H, .hxx, .hh. You can turn off automatic m | ||||
oc file generation by setting | ||||
QT_AUTOSCAN to 0. See also the corresponding Moc() builder method. | ||||
Automatic moc file generation from cxx files. As stated in the qt do | ||||
cumentation, include the moc | ||||
file at the end of the cxx file. Note that you have to include the fi | ||||
le, which is generated by the | ||||
transformation ${QT_MOCCXXPREFIX}<basename>${QT_MOCCXXSUFFIX}, by def | ||||
ault <basename>.moc. A warning | ||||
is generated after building the moc file, if you do not include the c | ||||
orrect file. If you are using | ||||
VariantDir, you may need to specify duplicate=1. You can turn off aut | ||||
omatic moc file generation by | ||||
setting QT_AUTOSCAN to 0. See also the corresponding Moc builder meth | ||||
od. | ||||
Automatic handling of .ui files. The implementation files generated | ||||
from .ui files are handled much | ||||
the same as yacc or lex files. Each .ui file given as a source of Pro | ||||
gram, Library or SharedLibrary | ||||
will generate three files, the declaration file, the implementation f | ||||
ile and a moc file. Because | ||||
there are also generated headers, you may need to specify duplicate=1 | ||||
in calls to VariantDir. See | ||||
also the corresponding Uic builder method. | ||||
RANLIB | RANLIB | |||
The archive indexer. | The archive indexer. | |||
RANLIBCOM | RANLIBCOM | |||
The command line used to index a static library archive. | The command line used to index a static library archive. | |||
RANLIBCOMSTR | RANLIBCOMSTR | |||
The string displayed when a static library archive is indexed. If thi s is not set, then $RANLIBCOM | The string displayed when a static library archive is indexed. If thi s is not set, then $RANLIBCOM | |||
(the command line) is displayed. | (the command line) is displayed. | |||
skipping to change at line 8656 | skipping to change at line 8715 | |||
env = Environment(TARCOMSTR = "Archiving $TARGET") | env = Environment(TARCOMSTR = "Archiving $TARGET") | |||
TARFLAGS | TARFLAGS | |||
General options passed to the tar archiver. | General options passed to the tar archiver. | |||
TARGET | TARGET | |||
A reserved variable name that may not be set or used in a constructio n environment. (See the manpage | A reserved variable name that may not be set or used in a constructio n environment. (See the manpage | |||
section "Variable Substitution" for more information). | section "Variable Substitution" for more information). | |||
TARGET_ARCH | TARGET_ARCH | |||
The name of the target hardware architecture for the compiled objects | The name of the hardware architecture that objects created using this | |||
created by this Environment. | construction environment should | |||
This defaults to the value of HOST_ARCH, and the user can override it | target. Can be set when creating a construction environment by passin | |||
. Currently only set for Win32. | g as a keyword argument in the | |||
Environment call. | ||||
On the win32 platform, if the Microsoft Visual C++ compiler is availa | ||||
ble, msvc tool setup is done | ||||
using $HOST_ARCH and $TARGET_ARCH. If a value is not specified, will | ||||
be set to the same value as | ||||
$HOST_ARCH. Changing the value after the environment is initialized w | ||||
ill not cause the tool to be | ||||
reinitialized. Compiled objects will be in the target architecture if | ||||
the compilation system supports | ||||
generating for that target. The latest compiler which can fulfill the | ||||
requirement will be selected, | ||||
unless a different version is directed by the value of the $MSVC_VERS | ||||
ION construction variable. | ||||
On the win32/msvc combination, valid target arch values are x86, arm, | ||||
i386 for 32-bit targets and | ||||
amd64, arm64, x86_64 and ia64 (Itanium) for 64-bit targets. For examp | ||||
le, if you want to compile | ||||
64-bit binaries, you would set TARGET_ARCH='x86_64' when creating the | ||||
construction environment. Note | ||||
that not all target architectures are supported for all Visual Studio | ||||
/ MSVC versions. Check the | ||||
relevant Microsoft documentation. | ||||
Sets the target architecture for the Visual C++ compiler (i.e. the ar | $TARGET_ARCH is not currently used by other compilation tools, but th | |||
ch of the binaries generated by | e option is reserved to do so in | |||
the compiler). If not set, default to $HOST_ARCH, or, if that is unse | future | |||
t, to the architecture of the | ||||
running machine's OS (note that the python build or architecture has | ||||
no effect). This variable must | ||||
be passed as an argument to the Environment() constructor; setting it | ||||
later has no effect. This is | ||||
currently only used on Windows, but in the future it will be used on | ||||
other OSes as well. If this is | ||||
set and $MSVC_VERSION is not set, this will search for all installed | ||||
MSVC's that support the | ||||
$TARGET_ARCH, selecting the latest version for use. | ||||
On Windows, valid target values are x86, arm, i386 for 32-bit targets | ||||
and amd64, arm64, em64t, x86_64 | ||||
and ia64 (Itanium) for 64-bit targets. Note that not all target archi | ||||
tectures are supported for all | ||||
Visual Studio / MSVC versions. Check the relevant Microsoft documenta | ||||
tion. | ||||
For example, if you want to compile 64-bit binaries, you would set TA | ||||
RGET_ARCH='x86_64' in your SCons | ||||
environment. | ||||
TARGET_OS | TARGET_OS | |||
The name of the target operating system for the compiled objects crea | The name of the operating system that objects created using this cons | |||
ted by this Environment. This | truction environment should | |||
defaults to the value of HOST_OS, and the user can override it. Curre | target. Can be set when creating a construction environment by passin | |||
ntly only set for Win32. | g as a keyword argument in the | |||
Environment call;. | ||||
$TARGET_OS is not currently used by SCons but the option is reserved | ||||
to do so in future | ||||
TARGETS | TARGETS | |||
A reserved variable name that may not be set or used in a constructio n environment. (See the manpage | A reserved variable name that may not be set or used in a constructio n environment. (See the manpage | |||
section "Variable Substitution" for more information). | section "Variable Substitution" for more information). | |||
TARSUFFIX | TARSUFFIX | |||
The suffix used for tar file names. | The suffix used for tar file names. | |||
TEMPFILE | ||||
A callable object used to handle overly long command line strings, si | ||||
nce operations which call out to | ||||
a shell will fail if the line is longer than the shell can accept. Th | ||||
is tends to particularly impact | ||||
linking. The tempfile object stores the command line in a temporary f | ||||
ile in the appropriate format, | ||||
and returns an alternate command line so the invoked tool will make u | ||||
se of the contents of the | ||||
temporary file. If you need to replace the default tempfile object, t | ||||
he callable should take into | ||||
account the settings of $MAXLINELENGTH, $TEMPFILEPREFIX, $TEMPFILESUF | ||||
FIX, $TEMPFILEARGJOIN, | ||||
$TEMPFILEDIR and $TEMPFILEARGESCFUNC. | ||||
TEMPFILEARGESCFUNC | TEMPFILEARGESCFUNC | |||
A default argument escape function is ``SCons.Subst.quote_spaces``. I | The default argument escape function is SCons.Subst.quote_spaces. If | |||
f you need to apply extra | you need to apply extra | |||
operations on a command argument before writing to a temporary file(f | operations on a command argument (to fix Windows slashes, normalize p | |||
ix Windows slashes, normalize | aths, etc.) before writing to | |||
paths, etc.), please set `TEMPFILEARGESCFUNC` variable to a custom fu | the temporary file, you can set the $TEMPFILEARGESCFUNC variable to a | |||
nction. Example:: | custom function. Such a | |||
function takes a single string argument and returns a new string with | ||||
any modifications applied. | ||||
Example: | ||||
import sys | import sys | |||
import re | import re | |||
from SCons.Subst import quote_spaces | from SCons.Subst import quote_spaces | |||
WINPATHSEP_RE = re.compile(r"\\([^\"'\\]|$)") | WINPATHSEP_RE = re.compile(r"\\([^\"'\\]|$)") | |||
def tempfile_arg_esc_func(arg): | def tempfile_arg_esc_func(arg): | |||
arg = quote_spaces(arg) | arg = quote_spaces(arg) | |||
if sys.platform != "win32": | if sys.platform != "win32": | |||
return arg | return arg | |||
# GCC requires double Windows slashes, let's use UNIX separat or | # GCC requires double Windows slashes, let's use UNIX separat or | |||
return WINPATHSEP_RE.sub(r"/\1", arg) | return WINPATHSEP_RE.sub(r"/\1", arg) | |||
env["TEMPFILEARGESCFUNC"] = tempfile_arg_esc_func | env["TEMPFILEARGESCFUNC"] = tempfile_arg_esc_func | |||
TEMPFILEARGJOIN | TEMPFILEARGJOIN | |||
The string (or character) to be used to join the arguments passed to | The string to use to join the arguments passed to $TEMPFILE when the | |||
TEMPFILE when command line | command line exceeds the limit | |||
exceeds the limit set by $MAXLINELENGTH. The default value is a space | set by $MAXLINELENGTH. The default value is a space. However for MSVC | |||
. However for MSVC, MSLINK the | , MSLINK the default is a line | |||
default is a line seperator characters as defined by os.linesep. Note | separator as defined by os.linesep. Note this value is used literally | |||
this value is used literally | and not expanded by the subst | |||
and not expanded by the subst logic. | logic. | |||
TEMPFILEDIR | TEMPFILEDIR | |||
The directory to create the tempfile in. | The directory to create the long-lines temporary file in. | |||
TEMPFILEPREFIX | TEMPFILEPREFIX | |||
The prefix for a temporary file used to store lines lines longer than | The prefix for the name of the temporary file used to store command l | |||
$MAXLINELENGTH as operations | ines exceeding $MAXLINELENGTH. | |||
which call out to a shell will fail if the line is too long, which pa | The default prefix is '@', which works for the Microsoft and GNU tool | |||
rticularly impacts linking. The | chains on Windows. Set this | |||
default is '@', which works for the Microsoft and GNU toolchains on W | appropriately for other toolchains, for example '-@' for the diab com | |||
indows. Set this appropriately | piler or '-via' for ARM | |||
for other toolchains, for example '-@' for the diab compiler or '-via | toolchain. | |||
' for ARM toolchain. | ||||
TEMPFILESUFFIX | TEMPFILESUFFIX | |||
The suffix used for the temporary file name used for long command lin | The suffix for the name of the temporary file used to store command l | |||
es. The name should include the | ines exceeding $MAXLINELENGTH. | |||
dot ('.') if one is wanted as it will not be added automatically. The | The suffix should include the dot ('.') if one is wanted as it will n | |||
default is '.lnk'. | ot be added automatically. The | |||
default is .lnk. | ||||
TEX | TEX | |||
The TeX formatter and typesetter. | The TeX formatter and typesetter. | |||
TEXCOM | TEXCOM | |||
The command line used to call the TeX formatter and typesetter. | The command line used to call the TeX formatter and typesetter. | |||
TEXCOMSTR | TEXCOMSTR | |||
The string displayed when calling the TeX formatter and typesetter. I f this is not set, then $TEXCOM | The string displayed when calling the TeX formatter and typesetter. I f this is not set, then $TEXCOM | |||
(the command line) is displayed. | (the command line) is displayed. | |||
skipping to change at line 9430 | skipping to change at line 9506 | |||
passed to the compiler. SCons provides a Variables object to support ove rriding construction variables | passed to the compiler. SCons provides a Variables object to support ove rriding construction variables | |||
with values obtained from various sources, often from the command line: | with values obtained from various sources, often from the command line: | |||
scons VARIABLE=foo | scons VARIABLE=foo | |||
The variable values can also be specified in a configuration file or an S Conscript file. | The variable values can also be specified in a configuration file or an S Conscript file. | |||
To obtain the object for manipulating values, call the Variables function : | To obtain the object for manipulating values, call the Variables function : | |||
Variables([files, [args]]) | Variables([files, [args]]) | |||
If files is a file or list of files, those are executed as Python scr ipts, and the values of (global) | If files is a file or list of files, they are executed as Python scri pts, and the values of (global) | |||
Python variables set in those files are added as construction variabl es in the Default Environment. | Python variables set in those files are added as construction variabl es in the Default Environment. | |||
If no files are specified, or the files argument is None, then no fil es will be read (supplying None | If no files are specified, or the files argument is None, then no fil es will be read (supplying None | |||
is necessary if there are no files but you want to specify args as a positional argument). | is necessary if there are no files but you want to specify args as a positional argument). | |||
The following example file contents could be used to set an alternati ve C compiler: | The following example file contents could be used to set an alternati ve C compiler: | |||
CC = 'my_cc' | CC = 'my_cc' | |||
If args is specified, it is a dictionary of values that will override | If args is specified, it is a dictionary of values that will override | |||
anything read from files. This | anything read from files. The | |||
is primarily intended to pass the ARGUMENTS dictionary that holds var | primary use is to pass the ARGUMENTS dictionary that holds variables | |||
iables specified on the command | specified on the command line, | |||
line. Example: | allowing you to indicate that if a setting appears on both the comman | |||
d line and in the file(s), the | ||||
command line setting takes precedence. However, any dictionary can be | ||||
passed. Examples: | ||||
vars = Variables('custom.py') | vars = Variables('custom.py') | |||
vars = Variables('overrides.py', ARGUMENTS) | vars = Variables('overrides.py', ARGUMENTS) | |||
vars = Variables(None, {FOO:'expansion', BAR:7}) | vars = Variables(None, {FOO:'expansion', BAR:7}) | |||
Calling Variables with no arguments is equivalent to: | Calling Variables with no arguments is equivalent to: | |||
vars = Variables(files=None, args=ARGUMENTS) | vars = Variables(files=None, args=ARGUMENTS) | |||
Note that since the variables are eventually added as construction va riables, you should choose | Note that since the variables are eventually added as construction va riables, you should choose | |||
variable names which do not unintentionally change pre-defined constr uction variables that your | variable names which do not unintentionally change pre-defined constr uction variables that your | |||
project will make use of (see the section called “Construction Variab les”). | project will make use of (see the section called “Construction Variab les”). | |||
Variables objects have the following methods: | Variables objects have the following methods: | |||
vars.Add(key, [help, default, validator, converter]) | vars.Add(key, [help, default, validator, converter]) | |||
Add a customizable construction variable to the Variables object. ke | Add a customizable construction variable to the Variables object. ke | |||
y is the name of the variable. | y is either the name of the | |||
help is the help text for the variable. default is the default value | variable, or a tuple (or list), in which case the first item in the t | |||
of the variable; if the default | uple is taken as the variable | |||
value is None and there is no explicit value specified, the construct | name, and any remaining values are considered aliases for the variabl | |||
ion variable will not be added | e. help is the help text for | |||
to the construction environment. If set, validator is called to valid | the variable (default empty string). default is the default value of | |||
ate the value of the variable. A | the variable (default None). If | |||
function supplied as a validator shall accept arguments: key, value, | default is None and a value is not specified, the construction variab | |||
and env. The recommended way to | le will not be added to the | |||
handle an invalid value is to raise an exception (see example below). | construction environment. | |||
If set, converter is called to | ||||
convert the value before putting it in the environment, and should ta | As a special case, if key is a tuple (or list) and is the only argume | |||
ke either a value, or the value | nt, the tuple is unpacked into | |||
and environment, as parameters. The converter function must return a | the five parameters listed above left to right, with any missing memb | |||
value, which will be converted | ers filled with the respecitive | |||
into a string before being validated by the validator (if any) and th | default values. This form allows Add to consume a tuple emitted by th | |||
en added to the construction | e convenience functions | |||
environment. | BoolVariable, EnumVariable, ListVariable, PackageVariable and PathVar | |||
iable. | ||||
If the optional validator is supplied, it is called to validate the v | ||||
alue of the variable. A function | ||||
supplied as a validator must accept three arguments: key, value and e | ||||
nv, and should raise an | ||||
exception with a helpful error message if value is invalid. No return | ||||
value is expected from the | ||||
validator. | ||||
If the optional converter is supplied, it is called to convert the va | ||||
lue before putting it in the | ||||
environment, and should take either a value or a value and environmen | ||||
t as parameters. The converter | ||||
function must return a value, which will be converted into a string a | ||||
nd be passed to the validator | ||||
(if any) and then added to the construction environment. | ||||
Examples: | Examples: | |||
vars.Add('CC', help='The C compiler') | vars.Add('CC', help='The C compiler') | |||
def valid_color(key, val, env): | def valid_color(key, val, env): | |||
if not val in ['red', 'blue', 'yellow']: | if not val in ['red', 'blue', 'yellow']: | |||
raise Exception("Invalid color value '%s'" % val) | raise Exception("Invalid color value '%s'" % val) | |||
vars.Add('COLOR', validator=valid_color) | vars.Add('COLOR', validator=valid_color) | |||
vars.AddVariables(args) | vars.AddVariables(args) | |||
A convenience method that adds multiple customizable construction var | A convenience method that adds one or more customizable construction | |||
iables to a Variables object in | variables to a Variables object | |||
one call; equivalent to calling Add multiple times. The args are tupl | in one call; equivalent to calling Add multiple times. The args are t | |||
es (or lists) that contain the | uples (or lists) that contain | |||
arguments for an individual call to the Add method. Since tuples are | the arguments for an individual call to the Add method. Since tuples | |||
not Python mappings, the | are not Python mappings, the | |||
arguments cannot use the keyword form, but rather are positional argu ments as documented for Add: a | arguments cannot use the keyword form, but rather are positional argu ments as documented for Add: a | |||
required name, the rest optional but must be in the specified in orde r if used. | required name, the other four optional, but must be in the specified order if used. | |||
opt.AddVariables( | opt.AddVariables( | |||
("debug", "", 0), | ("debug", "", 0), | |||
("CC", "The C compiler"), | ("CC", "The C compiler"), | |||
("VALIDATE", "An option for testing validation", "notset", va lidator, None), | ("VALIDATE", "An option for testing validation", "notset", va lidator, None), | |||
) | ) | |||
vars.Update(env, [args]) | vars.Update(env, [args]) | |||
Update a construction environment env with the customized constructio n variables . Any specified | Update a construction environment env with the customized constructio n variables. Any specified | |||
variables that are not configured for the Variables object will be sa ved and may be retrieved using | variables that are not configured for the Variables object will be sa ved and may be retrieved using | |||
the UnknownVariables method, below. | the UnknownVariables method. | |||
Normally this method is not called directly, but rather invoked indir ectly by passing the Variables | Normally this method is not called directly, but rather invoked indir ectly by passing the Variables | |||
object to the Environment function: | object to the Environment function: | |||
env = Environment(variables=vars) | env = Environment(variables=vars) | |||
vars.UnknownVariables() | vars.UnknownVariables() | |||
Returns a dictionary containing any variables that were specified eit her in the files or the | Returns a dictionary containing any variables that were specified eit her in the files or the | |||
dictionary with which the Variables object was initialized, but for w hich the Variables object was | dictionary with which the Variables object was initialized, but for w hich the Variables object was | |||
not configured. | not configured. | |||
env = Environment(variables=vars) | env = Environment(variables=vars) | |||
for key, value in vars.UnknownVariables(): | for key, value in vars.UnknownVariables(): | |||
print("unknown variable: %s=%s" % (key, value)) | print("unknown variable: %s=%s" % (key, value)) | |||
vars.Save(filename, env) | vars.Save(filename, env) | |||
Save the currently set variables into a script file named by filename | Save the currently set variables into a script file named by filename | |||
that can be used on the next | . Only variables that are set to | |||
invocation to automatically load the current settings. This method co | non-default values are saved. You can load these saved settings on a | |||
mbined with the Variables method | subsequent run by passing | |||
can be used to support caching of variables between runs. | filename to the Variables function, providing a way to cache particul | |||
ar settings for reuse. | ||||
env = Environment() | env = Environment() | |||
vars = Variables(['variables.cache', 'custom.py']) | vars = Variables(['variables.cache', 'custom.py']) | |||
vars.Add(...) | vars.Add(...) | |||
vars.Update(env) | vars.Update(env) | |||
vars.Save('variables.cache', env) | vars.Save('variables.cache', env) | |||
vars.GenerateHelpText(env, [sort]) | vars.GenerateHelpText(env, [sort]) | |||
Generate help text documenting the customizable construction variable s, suitable for passing in to | Generate help text documenting the customizable construction variable s, suitable for passing in to | |||
the Help function. env is the construction environment that will be used to get the actual values of | the Help function. env is the construction environment that will be used to get the actual values of | |||
skipping to change at line 9549 | skipping to change at line 9637 | |||
Returns a formatted string containing the printable help text for one option. It is normally not | Returns a formatted string containing the printable help text for one option. It is normally not | |||
called directly, but is called by the GenerateHelpText method to crea te the returned help text. It | called directly, but is called by the GenerateHelpText method to crea te the returned help text. It | |||
may be overridden with your own function that takes the arguments spe cified above and returns a | may be overridden with your own function that takes the arguments spe cified above and returns a | |||
string of help text formatted to your liking. Note that GenerateHelpT ext will not put any blank lines | string of help text formatted to your liking. Note that GenerateHelpT ext will not put any blank lines | |||
or extra characters in between the entries, so you must add those cha racters to the returned string | or extra characters in between the entries, so you must add those cha racters to the returned string | |||
if you want the entries separated. | if you want the entries separated. | |||
def my_format(env, opt, help, default, actual): | def my_format(env, opt, help, default, actual): | |||
fmt = "\n%s: default=%s actual=%s (%s)\n" | fmt = "\n%s: default=%s actual=%s (%s)\n" | |||
return fmt % (opt, default, actual, help) | return fmt % (opt, default, actual, help) | |||
vars.FormatVariableHelpText = my_format | vars.FormatVariableHelpText = my_format | |||
To make it more convenient to work with customizable Variables, scons pro vides a number of functions that | To make it more convenient to work with customizable Variables, scons pro vides a number of functions that | |||
make it easy to set up various types of Variables. Each of these return a tuple ready to be passed to the | make it easy to set up various types of Variables. Each of these return a tuple ready to be passed to the | |||
Add or AddVariables method: | Add or AddVariables method: | |||
BoolVariable(key, help, default) | BoolVariable(key, help, default) | |||
Returns a tuple of arguments to set up a Boolean option. The option w ill use the specified name key, | Returns a tuple of arguments to set up a Boolean option. The option w ill use the specified name key, | |||
have a default value of default, and help will form the descriptive p art of the help text. The option | have a default value of default, and help will form the descriptive p art of the help text. The option | |||
will interpret the values y, yes, t, true, 1, on and all as true, and the values n, no, f, false, 0, | will interpret the values y, yes, t, true, 1, on and all as true, and the values n, no, f, false, 0, | |||
skipping to change at line 10588 | skipping to change at line 10677 | |||
Newline characters (\n) delimit lines. The newline parsing is done af ter all other parsing, so it is | Newline characters (\n) delimit lines. The newline parsing is done af ter all other parsing, so it is | |||
not possible for arguments (e.g. file names) to contain embedded newl ine characters. | not possible for arguments (e.g. file names) to contain embedded newl ine characters. | |||
Note | Note | |||
Use of the Python eval function is considered to have security implic ations, since, depending on | Use of the Python eval function is considered to have security implic ations, since, depending on | |||
input sources, arbitrary unchecked strings of code can be executed by the Python interpreter. | input sources, arbitrary unchecked strings of code can be executed by the Python interpreter. | |||
Although SCons makes use of it in a somewhat restricted context, you should be aware of this issue | Although SCons makes use of it in a somewhat restricted context, you should be aware of this issue | |||
when using the ${python-expression-for-subst} form. | when using the ${python-expression-for-subst} form. | |||
Scanner Objects | Scanner Objects | |||
You can use the Scanner function to define objects to scan new file types | Scanner objects are used to scan specific file types for implicit depende | |||
for implicit dependencies. The | ncies. SCons has a number of | |||
Scanner function accepts the following arguments: | pre-built Scanner objects, so it is usually only necessary to set up Scan | |||
ners for new file types. You do | ||||
this by calling the Scanner function. The Scanner function accepts the fo | ||||
llowing arguments, only function | ||||
is required, the rest are optional: | ||||
function | function | |||
This can be either: | A Python function that will process a given Node (usually a file) and | |||
return a list of Nodes | ||||
· a Python function that will process the Node (file) and return a | representing the implicit dependencies (file names) found in the cont | |||
list of File Nodes representing | ents. The function must accept | |||
the implicit dependencies (file names) found in the contents. | three required arguments, node, env and path, and an optional fourth, | |||
arg. node is the internal | ||||
· a dictionary that maps keys (typically the file suffix, but see b | SCons node representing the file to scan, env is the construction env | |||
elow for more discussion) to | ironment to use during the scan, | |||
other Scanners that should be called. | and path is a tuple of directories that can be searched for files, as | |||
generated by the optional | ||||
If the argument is a Python function, the function must accept three | path_function (see below). If argument was supplied when the Scanner | |||
required arguments and an | object was created, it is given | |||
optional fourth: | as arg when the function is called; since argument is optional, the d | |||
node - | efault is no arg. | |||
The internal SCons node representing the file. | ||||
Use str(node) | The function can use use str(node) to fetch the name of the file, and | |||
to fetch the name of the file, and | node.get_contents() to fetch | |||
node.get_contents() | the contents of the file as bytes or node.get_text_contents() to fetc | |||
to fetch the contents of the file as bytes or | h the file's contents as text. | |||
node.get_text_contents() | Note that the file is not guaranteed to exist at the time the scanner | |||
to fetch the contents as text. | is called (it could be a | |||
Note that the file is | generated file, not generated yet), so the scanner function must be t | |||
not | olerant of that. | |||
guaranteed to exist before the scanner is called, | ||||
so the scanner function should check that | ||||
if there's any chance that the scanned file | ||||
might not exist | ||||
(for example, if it's built from other files). | ||||
env - The construction environment for the scan. | ||||
path - | ||||
A tuple (or list) | ||||
of directories that can be searched | ||||
for files. | ||||
This will usually be the tuple returned by the | ||||
path_function | ||||
argument (see below). | ||||
arg - | ||||
The argument supplied when the scanner was created, if any | ||||
(default None. | ||||
name | name | |||
The name of the Scanner. This is mainly used to identify the Scanner | The name to use for the Scanner. This is mainly used to identify the | |||
internally. The default value is | Scanner internally. The default | |||
"NONE". | value is "NONE". | |||
argument | argument | |||
An optional argument that, if specified, will be passed to the scanne | If specified, will be passed to the scanner function function and the | |||
r function (described above) and | path function path_function | |||
the path function (specified below). | when called, as the additional argument each of those functions takes | |||
. | ||||
skeys | skeys | |||
An optional list that can be used to determine which scanner should b | Scanner key(s) indicating the file types this scanner is associated w | |||
e used for a given Node. In the | ith. Used internally to select | |||
usual case of scanning for file names, this argument will be a list o | an appropriate scanner. In the usual case of scanning for file names, | |||
f suffixes for the different | this argument will be a list of | |||
file types that this Scanner knows how to scan. If the argument is a | suffixes for the different file types that this Scanner knows how to | |||
string, then it will be expanded | scan. If skeys is a string, it | |||
into a list by the current environment. | will be expanded into a list by the current environment. | |||
path_function | path_function | |||
A Python function that takes four or five arguments: a construction e nvironment, a Node for the | A Python function that takes four or five arguments: a construction e nvironment, a Node for the | |||
directory containing the SConscript file in which the first target wa s defined, a list of target | directory containing the SConscript file in which the first target wa s defined, a list of target | |||
nodes, a list of source nodes, and an optional argument supplied when | nodes, a list of source nodes, and the value of argument if it was su | |||
the scanner was created. The | pplied when the scanner was | |||
path_function returns a tuple of directories that can be searched for | created. Must return a tuple of directories that can be searched for | |||
files to be returned by this | files to be returned by this | |||
Scanner object. (Note that the FindPathDirs function can be used to r eturn a ready-made path_function | Scanner object. (Note that the FindPathDirs function can be used to r eturn a ready-made path_function | |||
for a given construction variable name, instead of having to write yo ur own function from scratch.) | for a given construction variable name, instead of having to write yo ur own function from scratch.) | |||
node_class | node_class | |||
The class of Node that should be returned by this Scanner object. Any strings or other objects | The class of Node that should be returned by this Scanner object. Any strings or other objects | |||
returned by the scanner function that are not of this class will be r un through the function supplied | returned by the scanner function that are not of this class will be r un through the function supplied | |||
by the node_factory argument. | by the node_factory argument. A value of None can be supplied to indi | |||
cate no conversion; the default | ||||
is to return File nodes. | ||||
node_factory | node_factory | |||
A Python function that will take a string or other object and turn it into the appropriate class of | A Python function that will take a string or other object and turn it into the appropriate class of | |||
Node to be returned by this Scanner object. | Node to be returned by this Scanner object, as indicated by node_clas s. | |||
scan_check | scan_check | |||
An optional Python function that takes two arguments, a Node (file) a | A Python function that takes two arguments, a Node (file) and a const | |||
nd a construction environment, | ruction environment, and returns | |||
and returns whether the Node should, in fact, be scanned for dependen | whether the Node should, in fact, be scanned for dependencies. This c | |||
cies. This check can be used to | heck can be used to eliminate | |||
eliminate unnecessary calls to the scanner function when, for example | unnecessary calls to the scanner function when, for example, the unde | |||
, the underlying file | rlying file represented by a | |||
represented by a Node does not yet exist. | Node does not yet exist. | |||
recursive | recursive | |||
An optional flag that specifies whether this scanner should be re-inv | Specifies whether this scanner should be re-invoked on the dependency | |||
oked on the dependency files | files returned by the scanner. | |||
returned by the scanner. When this flag is not set, the Node subsyste | If omitted, the Node subsystem will only invoke the scanner on the fi | |||
m will only invoke the scanner | le being scanned and not | |||
on the file being scanned, and not (for example) also on the files sp | recurse. Recursion is needed when the files returned by the scanner m | |||
ecified by the #include lines in | ay themselves contain further | |||
the file being scanned. recursive may be a callable function, in whi | file dependencies, as in the case of preprocessor #include lines. A v | |||
ch case it will be called with a | alue that evaluates true enables | |||
list of Nodes found and should return a list of Nodes that should be | recursion; recursive may be a callable function, in which case it wil | |||
scanned recursively; this can be | l be called with a list of Nodes | |||
used to select a specific subset of Nodes for additional scanning. | found and should return a list of Nodes that should be scanned recurs | |||
ively; this can be used to | ||||
select a specific subset of Nodes for additional scanning. | ||||
Note that scons has a global SourceFileScanner object that is used by the Object, SharedObject and | Note that scons has a global SourceFileScanner object that is used by the Object, SharedObject and | |||
StaticObject builders to decide which scanner should be used for differen t file extensions. You can use | StaticObject builders to decide which scanner should be used for differen t file extensions. You can use | |||
the SourceFileScanner.add_scanner() method to add your own Scanner object to the SCons infrastructure | the SourceFileScanner.add_scanner() method to add your own Scanner object to the SCons infrastructure | |||
that builds target programs or libraries from a list of source files of d ifferent types: | that builds target programs or libraries from a list of source files of d ifferent types: | |||
def xyz_scan(node, env, path): | def xyz_scan(node, env, path): | |||
contents = node.get_text_contents() | contents = node.get_text_contents() | |||
# Scan the contents and return the included files. | # Scan the contents and return the included files. | |||
skipping to change at line 10728 | skipping to change at line 10795 | |||
ability to interpret UNIX-like path names. For example, the Cygwin tools will internally translate a | ability to interpret UNIX-like path names. For example, the Cygwin tools will internally translate a | |||
Cygwin path name like /cygdrive/c/mydir to an equivalent Windows pathname of C:/mydir (equivalent to | Cygwin path name like /cygdrive/c/mydir to an equivalent Windows pathname of C:/mydir (equivalent to | |||
C:\mydir). | C:\mydir). | |||
Versions of Python that are built for native Windows execution, such as t he python.org and ActiveState | Versions of Python that are built for native Windows execution, such as t he python.org and ActiveState | |||
versions, do not have the Cygwin path name semantics. This means that usi ng a native Windows version of | versions, do not have the Cygwin path name semantics. This means that usi ng a native Windows version of | |||
Python to build compiled programs using Cygwin tools (such as gcc, bison and flex) may yield | Python to build compiled programs using Cygwin tools (such as gcc, bison and flex) may yield | |||
unpredictable results. "Mixing and matching" in this way can be made to w ork, but it requires careful | unpredictable results. "Mixing and matching" in this way can be made to w ork, but it requires careful | |||
attention to the use of path names in your SConscript files. | attention to the use of path names in your SConscript files. | |||
In practice, users can sidestep the issue by adopting the following rules | In practice, users can sidestep the issue by adopting the following rules | |||
: When using gcc, use the | : When using Cygwin's gcc for | |||
Cygwin-supplied Python interpreter to run scons; when using Microsoft Vis | compiling, use the Cygwin-supplied Python interpreter to run scons; when | |||
ual C/C++ (or some other Windows | using Microsoft Visual C/C++ (or | |||
compiler) use the python.org or Microsoft Store or ActiveState version of | some other Windows compiler) use the python.org or Microsoft Store or Act | |||
Python to run scons. | iveState version of Python to | |||
run scons. | ||||
Windows: scons.bat file | Windows: scons.bat file | |||
On Windows systems, scons is executed via a wrapper scons.bat file. This | On Windows, if scons is executed via a wrapper scons.bat batch file, ther | |||
has (at least) two | e are (at least) two | |||
ramifications: | ramifications. Note this is no longer the default - scons installed via P | |||
ython's pip installer will have | ||||
an scons.exe which does not have these limitations: | ||||
First, Windows command-line users that want to use variable assignment on the command line may have to | First, Windows command-line users that want to use variable assignment on the command line may have to | |||
put double quotes around the assignments: | put double quotes around the assignments, otherwise the Windows command s | |||
hell will consume those as | ||||
arguments to itself, not to scons: | ||||
scons "FOO=BAR" "BAZ=BLEH" | scons "FOO=BAR" "BAZ=BLEH" | |||
Second, the Cygwin shell does not recognize this file as being the same a | Second, the Cygwin shell does not reognize typing scons at the command li | |||
s an scons command issued at the | ne prompt as referring to this | |||
command-line prompt. You can work around this either by executing scons.b | weapper. You can work around this either by executing scons.bat (includin | |||
at from the Cygwin command line, | g the extension) from the Cygwin | |||
or by creating a wrapper shell script named scons. | command line, or by creating a wrapper shell script named scons which inv | |||
okes scons.bat. | ||||
MinGW | MinGW | |||
The MinGW bin directory must be in your PATH environment variable or the ['ENV']['PATH'] construction | The MinGW bin directory must be in your PATH environment variable or the ['ENV']['PATH'] construction | |||
variable for scons to detect and use the MinGW tools. When running under the native Windows Python | variable for scons to detect and use the MinGW tools. When running under the native Windows Python | |||
interpreter, scons will prefer the MinGW tools over the Cygwin tools, if they are both installed, | interpreter, scons will prefer the MinGW tools over the Cygwin tools, if they are both installed, | |||
regardless of the order of the bin directories in the PATH variable. If y ou have both MSVC and MinGW | regardless of the order of the bin directories in the PATH variable. If y ou have both MSVC and MinGW | |||
installed and you want to use MinGW instead of MSVC, then you must explic itly tell scons to use MinGW by | installed and you want to use MinGW instead of MSVC, then you must explic itly tell scons to use MinGW by | |||
passing tools=['mingw'] to the Environment function, because scons will p refer the MSVC tools over the | passing tools=['mingw'] to the Environment function, because scons will p refer the MSVC tools over the | |||
MinGW tools. | MinGW tools. | |||
skipping to change at line 10787 | skipping to change at line 10857 | |||
the user's home directory. If set to a pathname, will use that pathna me for the cache. | the user's home directory. If set to a pathname, will use that pathna me for the cache. | |||
Note: use this cache with caution as it might be somewhat fragile: wh ile each major toolset version | Note: use this cache with caution as it might be somewhat fragile: wh ile each major toolset version | |||
(e.g. Visual Studio 2017 vs 2019) and architecture pair will get sepa rate cache entries, if toolset | (e.g. Visual Studio 2017 vs 2019) and architecture pair will get sepa rate cache entries, if toolset | |||
updates cause a change to settings within a given release series, sco ns will not detect the change | updates cause a change to settings within a given release series, sco ns will not detect the change | |||
and will reuse old settings. Remove the cache file in case of problem s with this. scons will ignore | and will reuse old settings. Remove the cache file in case of problem s with this. scons will ignore | |||
failures reading or writing the file and will silently revert to non- cached behavior in such cases. | failures reading or writing the file and will silently revert to non- cached behavior in such cases. | |||
Available since scons 3.1 (experimental). | Available since scons 3.1 (experimental). | |||
QTDIR | ||||
If using the qt tool, this is the path to the Qt installation to buil | ||||
d against. SCons respects this | ||||
setting because it is a long-standing convention in the Qt world, whe | ||||
re multiple Qt installations are | ||||
possible. | ||||
SEE ALSO | SEE ALSO | |||
The SCons User Guide at | The SCons User Guide at | |||
https://scons.org/doc/production/HTML/scons-user.html | https://scons.org/doc/production/HTML/scons-user.html | |||
The SCons Design Document (old) | The SCons Design Document (old) | |||
The SCons Cookbook at | The SCons Cookbook at | |||
https://scons-cookbook.readthedocs.io | https://scons-cookbook.readthedocs.io | |||
for examples of how to solve various problems with SCons. | for examples of how to solve various problems with SCons. | |||
SCons source code | SCons source code | |||
on GitHub[5] | on GitHub[7] | |||
The SCons API Reference | The SCons API Reference | |||
https://scons.org/doc/production/HTML/scons-api/index.html | https://scons.org/doc/production/HTML/scons-api/index.html | |||
(for internal details) | (for internal details) | |||
AUTHORS | AUTHORS | |||
Originally: Steven Knight knight@baldmt.com and Anthony Roach aroach@elec triceyeball.com. | Originally: Steven Knight knight@baldmt.com and Anthony Roach aroach@elec triceyeball.com. | |||
Since 2010: The SCons Development Team scons-dev@scons.org. | Since 2010: The SCons Development Team scons-dev@scons.org. | |||
AUTHOR | AUTHOR | |||
The SCons Development Team | The SCons Development Team | |||
COPYRIGHT | COPYRIGHT | |||
Copyright © 2001 - 2021 The SCons Foundation | Copyright © 2001 - 2021 The SCons Foundation | |||
NOTES | NOTES | |||
1. LLVM specification | 1. https://github.com/SCons/scons-contrib | |||
https://github.com/SCons/scons-contrib | ||||
2. LLVM specification | ||||
https://clang.llvm.org/docs/JSONCompilationDatabase.html | https://clang.llvm.org/docs/JSONCompilationDatabase.html | |||
2. ninja package | 3. JEP 313 | |||
https:openjdk.java.net/jeps/313 | ||||
4. ninja package | ||||
https://pypi.org/project/ninja/ | https://pypi.org/project/ninja/ | |||
3. If no_progress is set via SetOption in an SConscript file (but not if set in a site_init.py file) | 5. If no_progress is set via SetOption in an SConscript file (but not if set in a site_init.py file) | |||
there will still be an initial status message about reading SConscrip t files since SCons has to start | there will still be an initial status message about reading SConscrip t files since SCons has to start | |||
reading them before it can see the SetOption. | reading them before it can see the SetOption. | |||
4. http://www.opensource.org/licenses/alphabetical | 6. http://www.opensource.org/licenses/alphabetical | |||
http://www.opensource.org/licenses/alphabetical | http://www.opensource.org/licenses/alphabetical | |||
5. on GitHub | 7. on GitHub | |||
https://github.com/SCons/scons | https://github.com/SCons/scons | |||
SCons 4.2.0 Version 4.2.0 <pubdate>Released Sat, 31 Jul 2021 18:12:46 -0700</pu bdate> SCONS(1) | SCons 4.3.0 Version 4.3.0 <pubdate>Released Tue, 16 Nov 2021 19:09:21 +0000</pu bdate> SCONS(1) | |||
End of changes. 97 change blocks. | ||||
411 lines changed or deleted | 555 lines changed or added |