Skip to content

Commit 4460298

Browse files
committed
Updating documentation for building on all platforms
1 parent d75c488 commit 4460298

File tree

2 files changed

+110
-23
lines changed

2 files changed

+110
-23
lines changed

COMPILING.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
Compiling Shockolate
2+
====================
3+
4+
Prerequisites:
5+
* CMake 3.11
6+
* SDL2 2.0.9
7+
* SDL2_mixer 2.0.4 (optional, for sound)
8+
* FluidSynth (optional)
9+
10+
The following CMake options are supported in the build process:
11+
* `ENABLE_SOUND` - enable sound support (requires SDL2_mixer)
12+
* `ENABLE_FLUIDSYNTH` - enable FluidSynth MIDI support (ON/LITE/OFF, default is embedded LITE)
13+
* `ENABLE_OPENGL` - enable OpenGL support (ON/OFF, default ON)
14+
15+
## Linux
16+
17+
Here example for Ubuntu. Since Shockolate requires decent multimedia libraries, you need add multimedia repository:
18+
19+
```
20+
sudo add-apt-repository -y ppa:savoury1/multimedia
21+
sudo apt-get -q update
22+
sudo apt-get install -y cmake libglu1-mesa-dev libgl1-mesa-dev libsdl2-dev libsdl2-mixer-dev
23+
```
24+
25+
Now you ready for building.
26+
27+
```
28+
mkdir systemshock_build
29+
cd systemshock_build
30+
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_OPENGL=ON -DENABLE_SOUND=ON <path to Shockolate sources>
31+
make -j2
32+
cp -r <path to Shockolate sources>/shaders . ; mkdir res
33+
```
34+
35+
After compilation you'll see systemshock executable in `systemshock_build` directory.
36+
37+
## macOS
38+
39+
Install dependencies via `brew`:
40+
41+
```
42+
brew install sdl2
43+
brew install sdl2_mixer
44+
```
45+
46+
Now you ready for building.
47+
48+
```
49+
mkdir systemshock_build
50+
cd systemshock_build
51+
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_OPENGL=ON -DENABLE_SOUND=ON <path to Shockolate sources>
52+
make -j2
53+
cp -r <path to Shockolate sources>/shaders . ; mkdir res
54+
```
55+
56+
After compilation you'll see systemshock executable in `systemshock_build` directory.
57+
58+
## Windows
59+
60+
### 64 bit
61+
Currently on Windows only MINGW environment is supported. We recommended [MSYS2](https://www.msys2.org/) for that.
62+
Install MSYS2 and launch MYS2 MinGW 64-bit shell. Install/update required tools:
63+
64+
```
65+
pacman -Syu --noconfirm # Close shell and open again
66+
pacman -Syu --noconfirm # Second run
67+
pacman -Sy --noconfirm mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja
68+
```
69+
70+
Install dependencies:
71+
72+
```
73+
pacman -Sy --noconfirm mingw-w64-x86_64-glew mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_mixer
74+
```
75+
76+
Now you ready to go. Let's assume that sources resides in `C:\project\systemshock`, then inside MinGW shell it would be
77+
`/c/project/systemshock`
78+
79+
```
80+
mkdir systemshock_build
81+
cd systemshock_build
82+
cmake -G 'Ninja' -DCMAKE_BUILD_TYPE=Release -DPKG_CONFIG_EXECUTABLE=/mingw64/bin/pkg-config.exe -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++.exe -DENABLE_SOUND=ON -DENABLE_OPENGL=ON /c/project/systemshock
83+
cmake --build . -j 2
84+
cp -r /c/project/systemshock/shader . ; mkdir res
85+
```
86+
87+
After compilation you'll see systemshock.exe executable in `systemshock_build` directory.
88+
89+
Importunately, currently MinGW build requires some DLLs from environment, there quick hack for it:
90+
91+
```
92+
cp /mingw64/bin/{libFLAC*,libglib-*,libgmodule-*,libmodplug*,libmpg123*,libportaudio-2,libreadline*,libsndfile*,libogg-*,libtermcap-0,libintl-*,libiconv-*,libopus-0,libpcre-*,libopusfile-0,libvorbis-0,libvorbisenc-2,libvorbisfile-*,libspeex-*}.dll .
93+
```
94+
95+
### 32 bit
96+
97+
There no big differences comparing to 64 bit. Launch MYS2 MinGW 32-bit shell and paste these commands:
98+
99+
```
100+
pacman -Syu --noconfirm # Close shell and open again
101+
pacman -Syu --noconfirm # Second run
102+
pacman -Sy --noconfirm mingw-w64-i686-toolchain mingw-w64-i686-cmake mingw-w64-i686-ninja
103+
pacman -Sy --noconfirm mingw-w64-i686-glew mingw-w64-i686-SDL2 mingw-w64-i686-SDL2_mixer
104+
mkdir systemshock_build
105+
cd systemshock_build
106+
cmake -G 'Ninja' -DCMAKE_BUILD_TYPE=Release -DPKG_CONFIG_EXECUTABLE=/mingw32/bin/pkg-config.exe -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc.exe -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++.exe -DENABLE_SOUND=ON -DENABLE_OPENGL=ON /c/project/systemshock
107+
cmake --build . -j 2
108+
cp -r /c/project/systemshock/shader . ; mkdir res
109+
```

README.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,29 +30,7 @@ Find a list of [downloadable packages](https://github.com/Interrupt/systemshock/
3030

3131
## From source code
3232

33-
Prerequisites:
34-
- [CMake](https://cmake.org/download/) installed
35-
36-
Step 1. Build the dependencies:
37-
* Windows: `build_win32.sh` or `build_win64.sh` (Git Bash and MinGW recommended)
38-
* Linux/Mac: `build_deps.sh` or the CI build scripts in `osx-linux`
39-
* Other: `build_deps.sh`
40-
41-
Step 2. Build and run the game itself
42-
```
43-
cmake .
44-
make systemshock
45-
./systemshock
46-
```
47-
48-
The following CMake options are supported in the build process:
49-
* `ENABLE_SDL2` - use system or bundled SDL2 (ON/BUNDLED, default BUNDLED)
50-
* `ENABLE_SOUND` - enable sound support (requires SDL2_mixer, ON/BUNDLED/OFF, default is BUNDLED)
51-
* `ENABLE_FLUIDSYNTH` - enable FluidSynth MIDI support (ON/BUNDLED/OFF, default is BUNDLED)
52-
* `ENABLE_OPENGL` - enable OpenGL support (ON/OFF, default ON)
53-
54-
If you find yourself needing to modify the build script for Shockolate itself, `CMakeLists.txt` is the place to look into.
55-
33+
See [COMPILING.md](COMPILING.md).
5634

5735
Command line parameters
5836
============

0 commit comments

Comments
 (0)