]> git.lizzy.rs Git - dragonblocks_alpha.git/blobdiff - BUILDING.md
Fix memory bug at shutdown
[dragonblocks_alpha.git] / BUILDING.md
index 2f5d97f0ce24b5e4684f41cb6adcb8dc135d9ed4..79243ec7168e4fbe9b782b0fd074481855997a89 100644 (file)
@@ -1,50 +1,48 @@
 # Building instructions
 
-CMake is used for compiling. Make sure to clone the repository recursively:
-
-```bash
-git clone --recurse-submodules https://github.com/dragonblocks/dragonblocks_alpha.git
-```
-
 ## Dependencies
-To build anything you need CMake and Lua. The ZLib development library is needed as well.
-The development versions of OpenGL, GLFW3, GLEW and Freetype are required to build the client.
-For building the server the SQLite3 development library is required.
-
+You need Git, CMake, Lua, Bash and GCC. Make sure these dependencies are installed on your system. (on Debian based systems: `apt install git cmake build-essential lua5.4`)
 
-Ubuntu / Debian:
+All other dependencies are included as submodules, compiled automatically and statically linked.
+Make sure to clone the repository recursively:
 
 ```bash
-sudo apt install build-essential cmake zlib1g-dev libgl1-mesa-dev libglfw3-dev libglew-dev libfreetype-dev libsqlite3-dev lua
+git clone --recurse-submodules https://github.com/dragonblocks/dragonblocks_alpha.git
 ```
 
-FreeBSD:
+## Client dependencies
 
-```csh
-sudo pkg install cmake gcc lzlib mesa-devel glfw glew freetype sqlite3 lua
-```
-
-OpenBSD:
+If you want to build the client, it is required to install the build dependencies for GLEW and GLFW (on X11/Debian based systems: `apt install xorg-dev libgl1-mesa-dev`).
 
-```sh
-sudo pkg_add cmake lzlib glfw glew freetype sqlite3 lua
-```
+Refer to:
+- https://www.glfw.org/docs/3.3/compile.html
+- http://glew.sourceforge.net/build.html
 
 ## Building a debug build
-By default CMake will make a Debug build if nothing else is specified. Simply use
+By default CMake will make a debug build if nothing else is specified. Simply use
 
 ```bash
-cd src
-cmake .
+cmake -B build -S src
+cd build
 make -j$(nproc)
 ```
 
 to build the dragonblocks client and server.
-If you use a debug build, the singleplayer script should be invoked from the src/ directory, because that's where the binaries are located.
+If you use a debug build, the singleplayer script should be invoked from the build/ directory, because that's where the binaries are located.
 
-## Building a snapshot
+## Building a release snapshot
 
 ```bash
+# Native snapshot
 ./snapshot.sh
+
+# Crosscompiling for windows
+
+# win32 (requires i686-w64-mingw32-gcc-posix)
+./snapshot.sh win32
+
+# win64 (requires x86_64-w64-mingw32-gcc-posix)
+./snapshot.sh win64
 ```
-This script will create a snapshot zipfile.
+
+Creates snapshot zipfiles.