« Prev 4.3.3.10 The Preprocess Builder | Table of Contents | Next » 4.3.3.12 The SharedLibrary Builder |
env.Program(target, sources) # Example env.Program("myprog", Rscons.glob("src/**/*.cc"))
The Program
builder compiles and links the given sources to an executable
file.
Object files, static library files, or source files can be given as sources
.
A platform-dependent program suffix will be appended to the target name if one
is not specified.
This can be controlled with the PROGSUFFIX
construction variable.
The Program builder supports a "direct" mode which is activated by specifying
the :direct
option.
In the direct mode, all source files are passed directly to the compiler
together and compiled and linked in one step, rather than being individually
compiled to separate object files first.
This mode allows taking advantage of any multi-file compilation capabilities
of the compiler.
However, it also requires recompiling all source files when any one of them
has changed.
Example use:
env.Program("myprog", Rscons.glob("src/**/*.c"), direct: true)
« Prev 4.3.3.10 The Preprocess Builder | Table of Contents | Next » 4.3.3.12 The SharedLibrary Builder |