-
Notifications
You must be signed in to change notification settings - Fork 78
Building on Windows
Mátyás Mustoha edited this page Mar 30, 2016
·
14 revisions
In this example, I'll use CodeBlocks, but the steps are mostly the same for eg. Visual Studio too.
- Clone the repository, including submodules (see Get the code)
- Install the latest CodeBlocks + MinGW (
codeblocks-16.01mingw-setup.exe
at the time of writing) - Install the latest CMake
- Get the dependencies:
- Download the SDL2 dev files for MinGW (SDL2-devel-2.x.x-mingw.tar.gz), and extract it somewhere
- Download SDL2 image for MinGW (SDL2_image-devel-2.x.x-mingw.tar.gz), and etract it to the same place as SDL2
- Download SDL2 mixer for MinGW (SDL2_mixer-devel-2.x.x-mingw.tar.gz), and etract it to the same place as SDL2
- Download zlib (compiled DLL, version 1.2.8, zipfile format), and extract it somewhere
- Set the SDL2DIR environment variable:
- on Windows 7: Control Panel -> System -> Advanced System Settings -> Environment Variables
- Click New
- Set
SDL2DIR
as name, then type in the full path to one one of the architecture inside the directory where you've extracted SDL2. For example,C:\SDL2-2.0.4\i686-w64-mingw32
(note: I recommendi686
, thex86_64
version may need additional tweaking). - Press Ok, Ok, Ok
- Create a build directory somewhere
- Open CMake,
-
Where is the source code
: open the directory of supermariowar -
Where to build
: open the build directory you've just created - Click Add entry, set
ZLIB_ROOT
as name,PATH
as type, then set the directory to where you've extracted zlib - Click Configure. Select
CodeBlock - MinGW
. - Turn on
Use SDL2 libs
- Click Configure again.
- If everything works, click Generate.
- Open the build directory, open the CodeBlocks project file. Select
smw
as build target, then start the build.
- Clone the repository, including submodules (see Get the code)
- Install MSYS2, and open its terminal
- Install the required packages:
pacman --noconfirm --needed -Sy pkg-config mingw-w64-i686-toolchain mingw-w64-i686-cmake mingw-w64-i686-zlib mingw-w64-i686-SDL2 mingw-w64-i686-SDL2_image mingw-w64-i686-SDL2_mixer
cd path/to/your/supermariowar; mkdir build; cd build
cmake .. -G 'Unix Makefiles' -DUSE_SDL2_LIBS=1
make smw