From: z411 Date: Mon, 13 Dec 2021 19:05:56 +0000 (+0000) Subject: Update Shared libraries (buildfiles) X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=07e4d9c36a8fbd35dd6760640f263c1daa53873f;p=xonotic%2Fxonotic.wiki.git Update Shared libraries (buildfiles) --- diff --git a/Shared-libraries-(buildfiles).md b/Shared-libraries-(buildfiles).md index 8c4561d..4b9a463 100644 --- a/Shared-libraries-(buildfiles).md +++ b/Shared-libraries-(buildfiles).md @@ -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`