This document describes how to setup a MYS2 toolchain to build the project in a Windows environment. Note that this guide is exclusive for a 64 bits build and that some steps are optional.
-
Download and install the last stable version from http://www.msys2.org/.
-
(OPTIONAL) Change language in
.bashrcto english and restart shell. It will use Window's by default.export LANG=en_US.UTF-8 -
Update MSYS2 default packages to the last version.
$ pacman -Syu $ pacman -SuNote: Don't worry if after the first step an error informing that the process could not be exited is shown. Just restart the shell and continue.
-
Install
mingw64bits complete toolchain.$ pacman -S mingw-w64-x86_64-toolchain --noconfirm -
Install
cmake.$ pacman -S mingw-w64-x86_64-cmake --noconfirmWarning: Do not install the package named
cmake, use the one above. -
(OPTIONAL) Add
makealias to.bashrc. This is to avoid having to typemingw32-makeevery time.alias make="mingw32-make"
-
(OPTIONAL) Install Git from a package using
pacman, or just add your current Git to thePATH.$ pacman -S git --noconfirm
-
Install OpenAL using
pacman, this will install the last current version (1.18.0).$ pacman -S mingw-w64-x86_64-openal --noconfirm -
Install SDL2 (current version 2.0.5).
$ pacman -S mingw-w64-x86_64-SDL2 --noconfirm -
Install WildMIDI manually (current version 0.4.1).
Since WildMidi is not available though package manager, it requires a manual installation. You can just use the command below to automate the whole process.
$ pacman -S unzip --noconfirm && \ wget https://github.com/Mindwerks/wildmidi/releases/download/wildmidi-0.4.1/wildmidi-0.4.1-win64.zip && \ unzip wildmidi-0.4.1-win64.zip && \ cp wildmidi-0.4.1-win64/mingw/*.h /mingw64/include/ && \ cp wildmidi-0.4.1-win64/mingw/*.a /mingw64/lib/Note: After that you can safely delete all the WildMidi files but
libWildMidi.dll. Required to run the binary -
Clone
OpenTESArenaand move to the directory.$ git clone https://github.com/afritz1/OpenTESArena.git $ cd OpenTESArena -
Create
builddirectory and move into it.$ mkdir build $ cd build -
Create make files with
cmake.$ cmake \ -D CMAKE_MAKE_PROGRAM="mingw32-make" \ -D CMAKE_BUILD_TYPE=Release \ -G "Unix Makefiles" ..Note: Both "Unix Makefiles" and "MingGW Makefiles" work. However, Unix option is simpler to use since it does not require to remove
shfrom the shell path. -
Use
makealias to build. Process should complete and you'll find the.exefile inside thebuilddirectory.$ make
-
Copy the generated
.exeto a directory of your choice. -
Follow instruction it https://github.com/afritz1/OpenTESArena#windows regarding setup of ARENA dir, options.txt and MIDI accordingly.
Remember that Midi setup is only required if you want to have sound.
-
Copy the required libraries to the deployment directory.
All of them are found inside the
msys64directory except for libWildMidi.dll, which is inside the WildMidi zip:- libgcc_s_seh-1.dll
- libopenal-1.dll
- libstdc++-6.dll
- libWildMidi.dll
- libwinpthread-1.dll
- SDL2.dll