]> git.lizzy.rs Git - dragonblocks_alpha.git/commitdiff
Add Win64 build
authorElias Fleckenstein <eliasfleckenstein@web.de>
Mon, 25 Apr 2022 13:45:50 +0000 (15:45 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Mon, 25 Apr 2022 13:45:50 +0000 (15:45 +0200)
.github/workflows/build.yml
.github/workflows/snapshot.yml
BUILDING.md
README.md
deps/dragonnet
snapshot.sh
src/CMakeLists.txt
src/mingw.cmake [deleted file]
src/win32.cmake [new file with mode: 0644]
src/win64.cmake [new file with mode: 0644]
upload.sh

index 574ae3148211a4b9d0e5fc936b7c6ec5c7b1b4d8..a4f887eb765de45d169f3127f5f370cbd3580820 100644 (file)
@@ -11,9 +11,9 @@ jobs:
       - 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)
index 232947f214ee1b883c4238d3e6f989c48948ec3e..516822b45a6664a33437fe8d0a94dc9c39985cea 100644 (file)
@@ -11,13 +11,16 @@ jobs:
       - 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 }}
index 723d2b71aadc8b352a558a34611ec5c6d8f5e7de..243eaea65eab7db5fda00b0762029c095c22f6f6 100644 (file)
@@ -1,7 +1,8 @@
 # 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:
 
@@ -9,6 +10,14 @@ 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
 
@@ -27,8 +36,13 @@ If you use a debug build, the singleplayer script should be invoked from the bui
 # 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.
index 581cf19d6b7bcca8989f31bc55f3206a2681e00b..5a14615846f3fc364209efa3f40be2cc1d76f25c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -9,12 +9,12 @@ Head to <https://www.elidragon.tk/dragonblocks_alpha/> for snapshot and release
 
 ```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:
index 72fd472f45d9589269d7786877dff8d45586c006..356f2ea3acb517cca7007556074aa0ed94b48876 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 72fd472f45d9589269d7786877dff8d45586c006
+Subproject commit 356f2ea3acb517cca7007556074aa0ed94b48876
index e99ab63474ec59939842768c1ae77aa112a56071..3aa830939e84793f3c42047206c4cf8339becbef 100755 (executable)
@@ -11,12 +11,14 @@ SNAPSHOT=dragonblocks_alpha-$VERSION
 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
@@ -24,7 +26,8 @@ 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)
index 6c9838a0f36dd22bb86df0c07fc5121b6952bcac..9aa405c4ade90ecb48d5b3534d81ee6d427ca596 100644 (file)
@@ -15,11 +15,13 @@ endif()
 
 # 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)
diff --git a/src/mingw.cmake b/src/mingw.cmake
deleted file mode 100644 (file)
index 2a51e36..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-set(CMAKE_SYSTEM_NAME Windows)
-
-set(CMAKE_C_COMPILER i686-w64-mingw32-gcc-posix)
-set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++-posix)
diff --git a/src/win32.cmake b/src/win32.cmake
new file mode 100644 (file)
index 0000000..2a51e36
--- /dev/null
@@ -0,0 +1,4 @@
+set(CMAKE_SYSTEM_NAME Windows)
+
+set(CMAKE_C_COMPILER i686-w64-mingw32-gcc-posix)
+set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++-posix)
diff --git a/src/win64.cmake b/src/win64.cmake
new file mode 100644 (file)
index 0000000..9024694
--- /dev/null
@@ -0,0 +1,4 @@
+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)
index 214981bf435c53007ba6c259a3e50b0ad075e219..9cb33a5b9937bea12dba356e340aed4fb271a405 100755 (executable)
--- a/upload.sh
+++ b/upload.sh
@@ -13,6 +13,7 @@ curl -f -i -X POST -H "Content-Type: multipart/form-data" \
        -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