This guide contains steps required to allow compilation of Cataclysm-DDA on Windows under MSYS2.
Steps from current guide were tested on Windows 10 (64 bit) and MSYS2 (64 bit), but should work for other versions of Windows and also MSYS2 (32 bit) if you download 32 bit version of all files.
- Computer with 64 bit version of modern Windows operating system installed (Windows 10, Windows 8.1 or Windows 7);
- NTFS partition with ~10 Gb free space (~2 Gb for MSYS2 installation, ~3 Gb for repository and ~5 Gb for ccache);
- 64 bit version of MSYS2 (installer can be downloaded from MSYS2 homepage);
Note: Windows XP is unsupported!
-
Go to MSYS2 homepage and download 64 bit installer (e.g. msys2-x86_64-20180531.exe).
-
Run downloaded file and install MSYS2 (click
Next
button, specify directory where MSYS2 64 bit will be installed (e.g.C:\msys64
), clickNext
button again, specify Start Menu folder name and clickInstall
button). -
After MSYS2 installation is complete press
Next
button, tickRun MSYS2 64 bit now
checkbox and pressFinish
button.
- Update the package database and core system packages with:
pacman -Syu
-
If asked close MSYS2 window and restart it from Start Menu or
C:\msys64\msys2_shell.cmd
. -
Update remaining packages with:
pacman -Su
- Install packages required for compilation with:
pacman -S git git-extras make mingw-w64-x86_64-{astyle,ccache,gcc,libmad,libwebp,ncurses,pkg-config,SDL2} mingw-w64-x86_64-SDL2_{image,mixer,ttf}
- Update paths in system-wide profile file (e.g.
C:\msys64\etc\profile
) as following:
- find lines:
MSYS2_PATH="/usr/local/bin:/usr/bin:/bin"
MANPATH='/usr/local/man:/usr/share/man:/usr/man:/share/man'
INFOPATH='/usr/local/info:/usr/share/info:/usr/info:/share/info'
and
PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig"
- and replace them with:
MSYS2_PATH="/usr/local/bin:/usr/bin:/bin:/mingw64/bin"
MANPATH='/usr/local/man:/usr/share/man:/usr/man:/share/man:/mingw64/share/man'
INFOPATH='/usr/local/info:/usr/share/info:/usr/info:/share/info:/mingw64/share/man'
and
PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig:/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig"
- Restart MSYS2 to apply path changes.
- Clone Cataclysm-DDA repository with following command line:
Note: This will download whole CDDA repository. If you're just testing you should probably add --depth=1
.
git clone https://github.com/CleverRaven/Cataclysm-DDA.git
cd Cataclysm-DDA
- Compile with following command line:
make CCACHE=1 RELEASE=1 MSYS2=1 DYNAMIC_LINKING=1 SDL=1 TILES=1 SOUND=1 LOCALIZE=1 LANGUAGES=all LINTJSON=0 ASTYLE=0 RUNTESTS=0
Note: This will compile release version with Sound and Tiles support and all localization languages, skipping checks and tests and using ccache for faster build. You can use other switches, but MSYS2=1
, DYNAMIC_LINKING=1
and probably RELEASE=1
are required to compile without issues.
- Run from within MSYS2 with following command line:
./cataclysm-tiles
Note: If you want to run compiled executable from Explorer you will also need to update user or system PATH
variable with path to MSYS2 runtime binaries (e.g. C:\msys64\mingw64\bin
).