Changing Build Settings

For each supported platform there is a configuration file with default settings. All the configuration files for the different platforms can be found under config/.

The usage of settings is pretty straightforward. There are some naming conventions that might help you in finding the proper section of settings.

Naming convention

Most features relying on external libraries (lib/windows or system libraries) are managed though the setting that starts with WITH_BF_ concatenated with the library name. WITH_BF_COLLADA governs thus the import/export of COLLADA. Set it to True, and you’ll have the feature compiled in. Set it to False, and you won’t get it. The setting name that is the library name prefixed with BF_ should point to the root directory of the external dependency. On Linux and other *nix systems that is most often /usr, on 32bit Windows it points to lib/windows/opencollada. Apart from these two, you’ll often see BF_OPENCOLLADA suffixed with ie. _INC, _LIB, _LIBPATH and so on. Those are mostly set so that they point to BF_OPENCOLLADA + the path part that would point to the proper paths, like BF_OPENCOLLADA_INC=’${ BF_OPENCOLLADA}/include/’. _LIB-ending settings only contain the library names used during final linking.

Where to make changes

Whenever you feel like making changes to the default settings, don’t do it in the platform default file. Instead, use either user-config.py, a custom-named configuration file, or the command-line. Both the user-config.py and the custom-named configuration file should be created in the same directory as the entry point of our system, SConstruct. Eg. C:\dev\blender\user-config.py.

user-config.py

This file will be automatically read if it exists and no custom configuration file has been specified on the command-line. Copy settings from the default configuration file that you want to change. Note: don’t ever copy the platform configuration file as your user-config.py. You will miss out on changes to default settings otherwise.

custom

You can also give a different name to your configuration file. For instance, I have a set of configuration files for different types of builds: win32/win64 builds, debug/release builds, and so on. I like to name them accordingly: msvc, msvcd, msvc64, msvc64d, mingw, mingwd.

To use a custom-named configuration file, you need to specify it on the command-line with BF_CONFIG, ie. python scons\scons.py BF_CONFIG=msvc64

When you do this, no user-config.py will be read. It’ll be skipped entirely. Often the different configuration files differ only on  BF_BUILDDIR and BF_INSTALLDIR settings, also optimization flags are often used differently across the configuration files.

command-line

The command-line can be used to override any setting given in the default configuration file or the user-created configuration file. My favourites are BF_NUMJOBS and BF_DEBUG (alongside the regular custom configuration already around the sources.

order of application

Our build system reads configuration files and settings in a specific order. Always the first is the platform specific default configuration file from config/. If a user-config.py is found or a custom configuration file is given, that is read next. Settings from these files override the ones given in the platform default configuration. As last the settings given on the command-line will be evaluated. That means settings given on the command-line will always be the ones in effect. Remember this when you’re trying to figure out what settings are at work in your builds.

Setting optimization flags

Many builders are interested in doing optimized compiles. These can give performance boosts in both the GUI when working with large scenes and during rendering. Official releases are built without them, since ie. optimized calculation using floats may lead to errors in the end-result.

If you still need to tweak optimization flags, you need to set them in CFLAGS, CCFLAGS or CXXFLAGS.

CFLAGS should contain flags that are only valid for C-compilation. CCFLAGS are flags that work for both C and C++. CXXFLAGS are solely flags for C++