Godot engine could be successfully compiled on Windows machine using MinGW toolchain only ( no VS dependencies ). This HOWTO was tested on Windows 10 x64 host.
Here's how you do it.
1. Download mingw_w64 installer
NOTE: Do not use GCC < 5.0 due to high possibilities of linker errors. Also, make sure to select seh or sjlj exception models and posix threads. I was using seh
3. Install Python for Windows
I was using Python 3.7.2 x64.
You will need SCons
build tool as long as the python extensions pywin32
. They could be obtained via pip.
Run in cmd: pip install pywin32
Also run in cmd: pip install scons
6. Open up cmd
and navigate to the root of your cloned Godot engine repository or to the unpacked source archive.
PATH=C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin;C:\Python37\Scripts;%PATH%
Make sure to substitute my paths and versions with yours.
You can change threads number according to your CPU ( -jN
, where N
is number of cores)
Also, make sure to read the docs for more build targets and options:
Godot build system Compiling for X11 (useful for targets)
scons -j4 platform=windows target=release_debug use_mingw=true
The resulting .exe file will be located inside the bin
folder within the source code tree.
To clean the build tree, invoke:
scons -c platform=windows target=release_debug use_mingw=true
Make sure to put in correct target name.
This manual was extremely useful IRC logs about linker errors with SizeTToULong
Check that Godot source is not modified or that you know what you're doing. Fix the code errors, if there are any. Ensure the right toolchain version.
They may vary. Common steps are to clean up the build tree, ensure the valid toolchain & environment vars and repeat the steps. Make sure to google error messages.
Make sure to export PATH variable manually before invoking scons.
Also, use more recent MinGW version ( GCC > 5 ).
I was experiencing longer link times and also a hanging linker while I was trying to build the debug
target.
There was also a known bug with MinGW linker but it might be non-relevant.
Last time I tried to build the 'debug' target, the build system seems to fall asleep.