SCons Windows
There are two compilers that are supported on Windows, Microsoft’s Visual C++ compiler (msvc) and the MingW GCC compiler (mingw). Both have somewhat differing setups ultimately, but much is still the same. I’ll walk you through the build process first for msvc, then also touch on the differences with mingw the builder should be aware of.
Tools
Install the following:
- Microsoft Visual Studio 2008 (if you install Visual C++ 2008 Express, also install Windows v6.1 SDK)
- Subversion
- Python 2.6.4
The subversion commands I give are for command-line, but if you work with TortoiseSVN or some other GUI to Subversion, I’m sure you’ll find out easily enough how to convert those to your needs. We’ll work with the command prompt shortcut that is provided by Visual Studio. It is called Visual Studio 2008 Command Prompt. This is a cmd.exe that has all environment variables set for compiling programs.
Visual Studio 2008
Do a full install, with default settings. I normally change the install path to something different from the default though, as I like to have it close to the root of the drive it is installed. I have my Visual Studio 2008 installed to C:\msvs9 and in that my Visual C++ is then installed in C:\msvs9\VC.
Python 2.6.4
Install the latest Python 2.6 version to its default location. This will be C:\Python26. To make things easier later on, add C:\Python26 to the PATH environment variable. (My Computer > Properties > Advanced System Settings > Environment Variables…).
Subversion
Get the latest Subversion client from the Subversion download page on tigris.org (get the Tigris.org binaries). Unzip the contents of the package to the directory C:\svn. Add also C:\svn\bin to your PATH as with the Python installation.
Other preparations
Create a folder called dev in C:\. We’ll be working from C:\dev from here on. Start now the Visual Studio 2008 Command Prompt and change directory to C:\dev: cd c:\dev
Getting the source
When you’re in C:\dev and you need your first checkout, you’ll have to do two of them to get the source in place. The commands below will put the source code and the prebuilt binaries in the right places. The first checkout of lib/windows will take quite a long time, as there are a few 100MB of prebuilt libraries downloaded.
svn co https://svn.blender.org/svnroot/bf-blender/trunk/blender blender
svn co https://svn.blender.org/svnroot/bf-blender/trunk/lib/windows lib/windows
After the checkouts complete you should have C:\dev\blender and C:\dev\lib\windows. In C:\dev\blender you should find the file SConstruct, which is the entry point for our build system.
Whenever you want to get the latest changes of the source and its dependencies, you cd into C:\dev\blender or C:\dev\lib\windows and give the command svn up.
Building Blender – default configuration
Change directories to C:\dev\blender. To build with the default configuration, you’ll need to ensure only one thing: make sure Quicktime support is disabled. This doesn’t come with lib/windows, so it needs to be installed separately, but we’ll look at that later.
To start a build, type the following in your still open command-line:
python scons\scons.py WITH_BF_QUICKTIME=0
Your build process should start, telling you what it is doing. The very first build (and every clean build) will take quite some time. If you’re on a multicore machine, you could add -j N where N 1 or larger. I usually use number of cores + 1.