]> git.rm.cloudns.org Git - xonotic/xonotic.wiki.git/commitdiff
Update Shared libraries (buildfiles)
authorz411 <electrik.persona@gmail.com>
Mon, 13 Dec 2021 19:05:56 +0000 (19:05 +0000)
committerz411 <electrik.persona@gmail.com>
Mon, 13 Dec 2021 19:05:56 +0000 (19:05 +0000)
Shared-libraries-(buildfiles).md

index 8c4561d83d042d0049ec7769965d20256c6cf1d0..4b9a4637cb3298fe6747f0302742d62b9c4ade3f 100644 (file)
@@ -96,6 +96,26 @@ Obtainment instructions:
 * download MSYS2 Package [1] in x86 and x64 versions: https://packages.msys2.org/base/mingw-w64-libpng
 * use dll from `bin` folder
 
+Cross-compiling: (WARNING: RESULTING LIBRARY DOESN'T LOAD - THIS MUST BE ADJUSTED!)
+
+```
+d0=$(pwd)
+PNGVER="libpng16"
+ZLIB_ROOT=$d0/../zlib/out # Location to the zlib compiled library
+
+git clone -b $PNGVER git://git.code.sf.net/p/libpng/code libpng || true
+curl -o x86_64-w64-mingw32.cmake https://raw.githubusercontent.com/zyga/cmake-toolchains/master/Toolchain-Ubuntu-mingw64.cmake
+
+rm -rf build
+mkdir build
+cd build
+cmake -DCMAKE_TOOLCHAIN_FILE="$d0/x86_64-w64-mingw32.cmake" -DPNG_STATIC=false -DPNG_TESTS=false -DPNG_EXECUTABLES=false -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DZLIB_INCLUDE_DIR=$ZLIB_ROOT/include -DZLIB_LIBRARY=$ZLIB_ROOT/lib/libzlib.dll.a -DCMAKE_INSTALL_PREFIX="$d0/out" -G"Unix Makefiles" "$d0/libpng"
+make
+make install
+cd "$d0"
+cp out/bin/libpng16.dll ~/Games/xonotic/misc/buildfiles/win64/libpng16.dll
+```
+
 ### macOS
 Darkplaces loads `libpng16.16.dylib` or `libpng15.15.dylib` or `libpng14.14.dylib` or `libpng12.0.dylib`