diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 74028c9..d10f3a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,3 +34,33 @@ jobs: sed '/#define _IRR_COMPILE_WITH_OPENGL_/ s|^|//|g' -i include/IrrCompileConfig.h cmake . make + + win32: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Install deps + run: | + sudo apt-get install cmake g++-mingw-w64-i686 -qyy + + - name: Build + run: | + ./scripts/ci-build-mingw.sh + env: + CC: i686-w64-mingw32-gcc + CXX: i686-w64-mingw32-g++ + + win64: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Install deps + run: | + sudo apt-get install cmake g++-mingw-w64-x86-64 -qyy + + - name: Build + run: | + ./scripts/ci-build-mingw.sh --64 + env: + CC: x86_64-w64-mingw32-gcc + CXX: x86_64-w64-mingw32-g++ diff --git a/scripts/ci-build-mingw.sh b/scripts/ci-build-mingw.sh new file mode 100755 index 0000000..edf63b7 --- /dev/null +++ b/scripts/ci-build-mingw.sh @@ -0,0 +1,36 @@ +#!/bin/bash -e + +variant=win32 +[[ "$1" == "--64" ]] && variant=win64 + +[[ -z "$CC" || -z "$CXX" ]] && exit 255 + +libjpeg_version=2.0.6 +libpng_version=1.6.37 +zlib_version=1.2.11 + +mkdir -p libs +pushd libs +libs=$PWD +[ -e libjpeg.zip ] || \ + wget "http://minetest.kitsunemimi.pw/libjpeg-$libjpeg_version-$variant.zip" -O libjpeg.zip +[ -e libpng.zip ] || \ + wget "http://minetest.kitsunemimi.pw/libpng-$libpng_version-$variant.zip" -O libpng.zip +[ -e zlib.zip ] || \ + wget "http://minetest.kitsunemimi.pw/zlib-$zlib_version-$variant.zip" -O zlib.zip +[ -d libjpeg ] || unzip -o libjpeg.zip -d libjpeg +[ -d libpng ] || unzip -o libpng.zip -d libpng +[ -d zlib ] || unzip -o zlib.zip -d zlib +popd + +cmake . \ + -DCMAKE_SYSTEM_NAME=Windows \ + -DPNG_LIBRARY=$libs/libpng/lib/libpng.dll.a \ + -DPNG_PNG_INCLUDE_DIR=$libs/libpng/include \ + -DJPEG_LIBRARY=$libs/libjpeg/lib/libjpeg.dll.a \ + -DJPEG_INCLUDE_DIR=$libs/libjpeg/include \ + -DZLIB_LIBRARY=$libs/zlib/lib/libz.dll.a \ + -DZLIB_INCLUDE_DIR=$libs/zlib/include + +make -j$(nproc) +exit 0