Articles

What is SCons command?

What is SCons command?

scons knows how to fetch files automatically from SCCS or RCS subdirectories using SCCS, RCS or BitKeeper. scons is normally executed in a top-level directory containing a SConstruct file, optionally specifying as command-line arguments the target file or files to be built.

Is SCons a compiler?

Unlike the GNU Compiler Collection’s (GCC) built-in dependency analysis, it uses a regular expression scan for included source files. SCons can also handle other languages or file types through user-defined builders. Building from central repositories of source code and pre-built targets.

Which Python does SCons use?

SCons will work with Python 2.7. x or with Python 3.5 or later. If you need to install Python and have a choice, we recommend using the most recent Python version available.

How can I speed up my SCons?

Decreasing SECONDS can improve build speed by eliminating superfluous MD5 checksum calculations. Instead of specifying this on the command line each run, you can set this option inside your SConstruct or SConscript file using “SetOption(‘max_drift’, SECONDS)”.

How to set the CCFLAGS value in SCons?

env[‘CCFLAGS’] = ‘-g’. env.Program(‘hello’, ‘hello.cpp’) The first line creates a new environment, the second sets the CCFLAGS value for that environment, and the third tells SCons to build hello using the environment env, instead of the global settings.

What does SCons add to the compilation command line?

SCons will add to the compilation command line (s) the right -I options, or whatever similar options are appropriate for the C or C++ compiler you’re using. This makes your SCons-based build configuration portable. Note specifically that you should not set the include directories directly in the CCFLAGS variable, as you might initially expect:

Do you need to set include directories in CCFLAGS?

Note specifically that you should not set the include directories directly in the CCFLAGS variable, as you might initially expect: This will make the program compile correctly, but SCons will not find the dependencies in the “inc” subdirectory and the program will not be rebuilt if any of those #include files change.

Why does SCons not propagate to the external environment?

SCons does not automatically propagate the external environment used to execute ‘ scons ‘ to the commands used to build target files. This is so that builds will be guaranteed repeatable regardless of the environment variables set at the time scons is invoked.