- name: Install deps
run: |
sudo apt-get update
- sudo apt-get install -y build-essential cmake libgl1-mesa-dev libglfw3-dev libglew-dev libsqlite3-dev zlib1g-dev lua5.3
+ sudo apt-get install -y build-essential cmake lua5.3 xorg-dev libgl-dev
- name: Build
run: |
- cd src
- cmake .
+ cmake -B build -S src
+ cd build
make -j$(nproc)
- name: Install deps
run: |
sudo apt-get update
- sudo apt-get install -y build-essential cmake lua5.3 curl zip
- - name: Build ubuntu snapshot
+ sudo apt-get install -y build-essential cmake lua5.3 xorg-dev libgl-dev mingw-w64 curl zip
+ - name: Build linux snapshot
run: |
./snapshot.sh
- - name: Build windows snapshot
+ - name: Build win32 snapshot
run: |
- ./snapshot.sh mingw
+ ./snapshot.sh win32
+ - name: Build win64 snapshot
+ run: |
+ ./snapshot.sh win64
- name: Upload snapshots
env:
SECRET: ${{ secrets.ELIDRAGON_UPLOAD_TOKEN }}
# Building instructions
## Dependencies
-To build anything you need Git, CMake, Lua, Bash and GCC. Make sure these dependencies are installed on your system.
+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`)
+
All other dependencies are included as submodules, compiled automatically and statically linked.
Make sure to clone the repository recursively:
git clone --recurse-submodules https://github.com/dragonblocks/dragonblocks_alpha.git
```
+## Client dependencies
+
+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 libgl-dev`).
+
+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
# Native snapshot
./snapshot.sh
-# Crosscompiling for windows (requires i686-w64-mingw32-gcc-posix)
-./snapshot.sh mingw
+# Crosscompiling for windows
+
+# win32 (requires i686-w64-mingw32-gcc-posix)
+./snapshot.sh win32
+
+# win64 (requires x86_64-w64-mingw32-gcc-posix)
+./snapshot.sh win64
```
Creates snapshot zipfiles.
```sh
# on posix
-./dragonblocks_server "[<address>]:<port>"
-./dragonblocks_client "[<address>]:<port>"
+./dragonblocks_server "<address>:<port>"
+./dragonblocks_client "<address>:<port>"
# on windows
-dragonblocks_server.exe "[<address>]:<port>"
-dragonblocks_client.exe "[<address>]:<port>"
+dragonblocks_server.exe "<address>:<port>"
+dragonblocks_client.exe "<address>:<port>"
```
or alternatively:
-Subproject commit 72fd472f45d9589269d7786877dff8d45586c006
+Subproject commit 356f2ea3acb517cca7007556074aa0ed94b48876
TOOLCHAIN=
DOTEXE=
DOTSH=".sh"
-if [[ "$1" == "mingw" ]]; then
- BUILD=build-mingw
- SNAPSHOT=dragonblocks_alpha-win64-$VERSION
- TOOLCHAIN=mingw.cmake
+FLAGS="-Ofast"
+if [[ "$1" != "" ]]; then
+ BUILD=build-$1
+ SNAPSHOT=dragonblocks_alpha-$1-$VERSION
+ TOOLCHAIN=$1.cmake
DOTEXE=".exe"
DOTSH=".bat"
+ FLAGS="$FLAGS -static"
fi
mkdir -p $BUILD
cmake -B $BUILD -S src \
-DCMAKE_BUILD_TYPE="Release" \
-DASSET_PATH="assets/" \
- -DCMAKE_C_FLAGS="-Ofast" \
+ -DCMAKE_C_FLAGS="$FLAGS" \
+ -DCMAKE_CXX_FLAGS="$FLAGS" \
-DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN"
make --no-print-directory -C $BUILD -j$(nproc)
# Dependencies
-cmake_policy(SET CMP0077 NEW)
+set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
set(SKIP_INSTALL_ALL ON)
set(BUILD_SHARED_LIBS OFF)
+
set(ZLIB_LIBRARY zlibstatic)
+set(ZLIB_INCLUDE_DIR "${DEPS_DIR}/zlib")
set(FT_DISABLE_ZLIB OFF)
set(FT_DISABLE_BZIP2 ON)
+++ /dev/null
-set(CMAKE_SYSTEM_NAME Windows)
-
-set(CMAKE_C_COMPILER i686-w64-mingw32-gcc-posix)
-set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++-posix)
--- /dev/null
+set(CMAKE_SYSTEM_NAME Windows)
+
+set(CMAKE_C_COMPILER i686-w64-mingw32-gcc-posix)
+set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++-posix)
--- /dev/null
+set(CMAKE_SYSTEM_NAME Windows)
+
+set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc-posix)
+set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++-posix)
-F "secret=$SECRET" \
-F "name=$VERSION" \
-F "is_release=$IS_RELEASE" \
- -F "ubuntu=@dragonblocks_alpha-$VERSION.zip" \
- -F "windows=@dragonblocks_alpha-win64-$VERSION.zip" \
+ -F "linux=@dragonblocks_alpha-$VERSION.zip" \
+ -F "win32=@dragonblocks_alpha-win32-$VERSION.zip" \
+ -F "win64=@dragonblocks_alpha-win64-$VERSION.zip" \
https://elidragon.tk/dragonblocks_alpha/upload.php