Building Blender/Options

= Build Options =

By default Blender builds will be similar to official releases. Many build options are available for debugging, faster builds, and to enable or disable various features.

Build Targets
There are a few build targets to choose the overall type of build.


 * make - build with all features enabled, except Cycles GPU binaries
 * make lite - build with the absolute minimum amount of features enabled, either for faster builds or to avoid installing many dependencies
 * make release - complete build with all options enabled including Cycles GPU binaries, matching the releases on blender.org
 * make headless - build designed to run from the command line without an interface (for renderfarm or server automation)
 * make bpy - build as a python module which can be loaded from python directly

For a full list of targets, run make help.

Debug Builds
On Windows in Visual Studio or Xcode on macOS, a single build folder can contain both release and debug builds, and you can switch between them in the IDE.

For other platforms, the easiest way to set up a debug build is to build the debug target. This will create a separate build in ../build_ _debug.

The build type of an existing build can also be changed by setting CMAKE_BUILD_TYPE in the CMake configuration to either Debug</tt> or RelWithDebInfo</tt>.

Developer Options
We recommend developers to configure CMake to enable address sanitizer, automated tests and options for faster builds. More details about tools for Blender development are here.

The most common options can be enabled by using the developer</tt> target, which can be combined with other targets. For example:

Or to combine it with a debug build as you usually would:

Ninja
For faster builds, the Ninja build system can be used. If ninja is installed and available in the path, it can be added to the make</tt> command when setting up the build folder. If there already exists a build folder with a different build system, the folder must be removed first. Example command to set up ninja build:

Caching
Caching helps make rebuilds faster, especially when switching between git revisions and branches.

Linux and macOS
If ccache is installed, it can be used as follows: make ccache

It can be combined with other options, for example: make debug developer ccache ninja

The equivalent of the above for Xcode generator would be: cmake -S. -B ../build_xcode -C build_files/cmake/config/blender_developer.cmake -DWITH_COMPILER_CCACHE=ON -G Xcode

Windows
If sccache is installed and available in the path it can be used, however it will only function with the ninja generator.

Editing CMake Options
By default, the CMakeCache.txt</tt> configuration file will be in ../build_&lt;platform&gt;</tt>. There are a multiple ways to edit it.


 * Editing CMakeCache.txt</tt> in a text editor.
 * Opening CMakeCache.txt</tt> with the CMake GUI, to easily change options and re-configure. For example on Linux:


 * Using ccmake, for a command line text interface to easily change options and re-configure.


 * cmake parameters can also be set on the command line, for example:
 * These commands are exactly those found in CMakeCache.txt</tt> so you can copy commands from there and use them in the command line without running ccmake.
 * These commands are exactly those found in CMakeCache.txt</tt> so you can copy commands from there and use them in the command line without running ccmake.

Reproducible Builds
Blender's release builds use the option WITH_BUILDINFO</tt>

This includes build date and time, which means each build will be slightly different from the previous.

Typically you can just disable the WITH_BUILDINFO</tt> option, if you don't want this, however projects may want to be able to create reproducible builds. See: https://wiki.debian.org/ To support this we have 2 optional CMake variables:


 * BUILDINFO_OVERRIDE_DATE</tt>, formatted YYYY-MM-DD</tt> (year:month:day). eg "2016-07-11"
 * BUILDINFO_OVERRIDE_TIME</tt>, formatted HH:MM:SS</tt> (hour:min:seconds). eg "23:54:05"

When defined, these will override the current date and time.