CI: add workflows for win32 and win64

This commit is contained in:
sfan5 2021-03-08 23:48:28 +01:00
parent 0a09f98c74
commit cadbd62271
2 changed files with 66 additions and 0 deletions

View File

@ -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++

36
scripts/ci-build-mingw.sh Executable file
View File

@ -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