Update MinGW CI setup to match MT's

This commit is contained in:
sfan5 2022-02-04 21:08:37 +01:00
parent e5f69157db
commit d3132e0731
2 changed files with 38 additions and 14 deletions

@ -58,37 +58,49 @@ jobs:
LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest
win32: win32:
runs-on: ubuntu-18.04 runs-on: ubuntu-20.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install deps - name: Install compiler
run: | run: |
sudo apt-get update sudo apt-get update && sudo apt-get install cmake -qyy
sudo apt-get install cmake g++-mingw-w64-i686 -qyy wget http://minetest.kitsunemimi.pw/mingw-w64-i686_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
sudo tar -xaf mingw.tar.xz -C /usr
- name: Build - name: Build
run: | run: |
./scripts/ci-build-mingw.sh ./scripts/ci-build-mingw.sh package
env: env:
CC: i686-w64-mingw32-gcc CC: i686-w64-mingw32-gcc
CXX: i686-w64-mingw32-g++ CXX: i686-w64-mingw32-g++
- uses: actions/upload-artifact@v2
with:
name: irrlicht-win32
path: ./irrlicht-windows.zip
win64: win64:
runs-on: ubuntu-18.04 runs-on: ubuntu-20.04
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install deps - name: Install compiler
run: | run: |
sudo apt-get update sudo apt-get update && sudo apt-get install cmake -qyy
sudo apt-get install cmake g++-mingw-w64-x86-64 -qyy wget http://minetest.kitsunemimi.pw/mingw-w64-x86_64_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
sudo tar -xaf mingw.tar.xz -C /usr
- name: Build - name: Build
run: | run: |
./scripts/ci-build-mingw.sh ./scripts/ci-build-mingw.sh package
env: env:
CC: x86_64-w64-mingw32-gcc CC: x86_64-w64-mingw32-gcc
CXX: x86_64-w64-mingw32-g++ CXX: x86_64-w64-mingw32-g++
- uses: actions/upload-artifact@v2
with:
name: irrlicht-win64
path: ./irrlicht-windows.zip
macos: macos:
runs-on: macos-10.15 runs-on: macos-10.15
steps: steps:

@ -5,25 +5,27 @@
variant=win32 variant=win32
[[ "$(basename "$CXX")" == "x86_64-"* ]] && variant=win64 [[ "$(basename "$CXX")" == "x86_64-"* ]] && variant=win64
libjpeg_version=2.0.6 libjpeg_version=2.1.2
libpng_version=1.6.37 libpng_version=1.6.37
zlib_version=1.2.11 zlib_version=1.2.11
mkdir -p libs mkdir -p libs
pushd libs pushd libs
libs=$PWD libs=$PWD
tmp=
[ "$variant" = win32 ] && tmp=dw2/
[ -e libjpeg.zip ] || \ [ -e libjpeg.zip ] || \
wget "http://minetest.kitsunemimi.pw/libjpeg-$libjpeg_version-$variant.zip" -O libjpeg.zip wget "http://minetest.kitsunemimi.pw/libjpeg-$libjpeg_version-$variant.zip" -O libjpeg.zip
[ -e libpng.zip ] || \ [ -e libpng.zip ] || \
wget "http://minetest.kitsunemimi.pw/libpng-$libpng_version-$variant.zip" -O libpng.zip wget "http://minetest.kitsunemimi.pw/${tmp}libpng-$libpng_version-$variant.zip" -O libpng.zip
[ -e zlib.zip ] || \ [ -e zlib.zip ] || \
wget "http://minetest.kitsunemimi.pw/zlib-$zlib_version-$variant.zip" -O zlib.zip wget "http://minetest.kitsunemimi.pw/${tmp}zlib-$zlib_version-$variant.zip" -O zlib.zip
[ -d libjpeg ] || unzip -o libjpeg.zip -d libjpeg [ -d libjpeg ] || unzip -o libjpeg.zip -d libjpeg
[ -d libpng ] || unzip -o libpng.zip -d libpng [ -d libpng ] || unzip -o libpng.zip -d libpng
[ -d zlib ] || unzip -o zlib.zip -d zlib [ -d zlib ] || unzip -o zlib.zip -d zlib
popd popd
cmake . \ tmp=(
-DCMAKE_SYSTEM_NAME=Windows \ -DCMAKE_SYSTEM_NAME=Windows \
-DPNG_LIBRARY=$libs/libpng/lib/libpng.dll.a \ -DPNG_LIBRARY=$libs/libpng/lib/libpng.dll.a \
-DPNG_PNG_INCLUDE_DIR=$libs/libpng/include \ -DPNG_PNG_INCLUDE_DIR=$libs/libpng/include \
@ -31,6 +33,16 @@ cmake . \
-DJPEG_INCLUDE_DIR=$libs/libjpeg/include \ -DJPEG_INCLUDE_DIR=$libs/libjpeg/include \
-DZLIB_LIBRARY=$libs/zlib/lib/libz.dll.a \ -DZLIB_LIBRARY=$libs/zlib/lib/libz.dll.a \
-DZLIB_INCLUDE_DIR=$libs/zlib/include -DZLIB_INCLUDE_DIR=$libs/zlib/include
)
[ "$1" = "package" ] && tmp+=(-DCMAKE_EXE_LINKER_FLAGS="-s")
cmake . "${tmp[@]}"
make -j$(nproc) make -j$(nproc)
if [ "$1" = "package" ]; then
make DESTDIR=$PWD/_install install
# bundle the DLLs that are specific to Irrlicht (kind of a hack)
cp -p $libs/*/bin/lib{jpeg,png}*.dll _install/usr/local/lib/
(cd _install/usr/local; zip -9r "$OLDPWD"/irrlicht-windows.zip -- *)
fi
exit 0 exit 0