2018-11-18 16:33:32 +01:00
#!/bin/bash
2018-12-17 00:53:00 +01:00
. scripts/lib.sh
2018-11-18 16:33:32 +01:00
# Build engine
cd $TRAVIS_BUILD_DIR
export CC = "ccache i686-w64-mingw32-gcc"
export CXX = "ccache i686-w64-mingw32-g++"
2019-03-21 15:47:16 +01:00
export CFLAGS = "-static-libgcc -no-pthread -msse2" # add sse2 to workaround mingw multiple definition of MemoryBarrier bug
export CXXFLAGS = "-static-libgcc -static-libstdc++ -no-pthread -msse2"
2019-02-23 12:32:49 +01:00
export LDFLAGS = "-static-libgcc -static-libstdc++ -no-pthread"
export LINKFLAGS = "-static-libgcc -static-libstdc++ -no-pthread"
2018-11-18 21:59:23 +01:00
export WINRC = "i686-w64-mingw32-windres"
2019-01-13 14:26:00 +01:00
rm -rf build # clean build directory
2018-12-17 00:53:00 +01:00
./waf configure --sdl2= $TRAVIS_BUILD_DIR /SDL2_mingw/i686-w64-mingw32/ --disable-vgui --build-type= debug --verbose || die # can't compile VGUI support on MinGW, due to differnet C++ ABI
./waf build -j2 --verbose || die
2018-12-13 01:25:46 +01:00
cp $TRAVIS_BUILD_DIR /SDL2_mingw/i686-w64-mingw32//bin/SDL2.dll . # Install SDL2
2018-12-12 02:49:11 +01:00
cp vgui_support_bin/vgui_support.dll .
2019-01-13 14:26:00 +01:00
cp build/engine/xash.dll .
cp build/mainui/menu.dll .
cp build/game_launch/xash3d.exe .
2018-12-12 02:49:11 +01:00
7z a -t7z $TRAVIS_BUILD_DIR /xash3d-mingw.7z -m0= lzma2 -mx= 9 -mfb= 64 -md= 32m -ms= on *.dll *.exe