]> de.git.xonotic.org Git - xonotic/xonotic.wiki.git/commitdiff
Added ZLIB cross-compile instructions
authorz411 <electrik.persona@gmail.com>
Mon, 13 Dec 2021 18:32:23 +0000 (18:32 +0000)
committerz411 <electrik.persona@gmail.com>
Mon, 13 Dec 2021 18:32:23 +0000 (18:32 +0000)
Shared-libraries-(buildfiles).md

index 5d94e75a0295ffee1df7e30e94947a03c72c07e8..a92c71e474a6975442cefee5e79634f64f62832d 100644 (file)
@@ -76,6 +76,26 @@ Obtainment instructions:
 * download as MSYS2 Package [1] in x86 and x64 versions: https://packages.msys2.org/base/mingw-w64-zlib
 * use dll from `bin` folder
 
+Cross-compiling:
+
+```
+ZLIBVER="1.2.11"
+curl -L -o zlib-$ZLIBVER.tar.xz https://zlib.net/zlib-$ZLIBVER.tar.xz || true
+tar -xf zlib-$ZLIBVER.tar.xz
+rm zlib-$ZLIBVER.tar.xz
+
+curl -o x86_64-w64-mingw32.cmake https://raw.githubusercontent.com/zyga/cmake-toolchains/master/Toolchain-Ubuntu-mingw64.cmake
+d0=$(pwd)
+rm -rf build
+mkdir build
+cd build
+cmake -DCMAKE_TOOLCHAIN_FILE="$d0/x86_64-w64-mingw32.cmake" -DBUILD_SHARED_LIBS=true -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_INSTALL_PREFIX="$d0/out" -G"Unix Makefiles" "$d0/zlib-$ZLIBVER"
+make
+make install
+cd "$d0"
+cp out/bin/libzlib1.dll ~/Games/xonotic/misc/buildfiles/win64/zlib1.dll
+```
+
 ### macOS
 Darkplaces loads `libz.dylib`