From e2606cf97f0e14a960d1b317bf295e7752b74529 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 17 Dec 2018 02:53:00 +0300 Subject: [PATCH] scripts: stop executing script and print config.log, if waf was failed. --- scripts/build_linux_engine.sh | 6 ++++-- scripts/build_mingw_engine.sh | 6 ++++-- scripts/build_osx_engine.sh | 6 ++++-- scripts/lib.sh | 5 +++++ 4 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 scripts/lib.sh diff --git a/scripts/build_linux_engine.sh b/scripts/build_linux_engine.sh index 527c7262..9fb4b945 100755 --- a/scripts/build_linux_engine.sh +++ b/scripts/build_linux_engine.sh @@ -2,6 +2,8 @@ # Build custom SDL2 +. scripts/lib.sh + cd $TRAVIS_BUILD_DIR/SDL2_src export CC="ccache gcc -msse2 -march=i686 -m32 -ggdb -O2" ./configure \ @@ -29,8 +31,8 @@ make install DESTDIR=$TRAVIS_BUILD_DIR/SDL2_linux cd $TRAVIS_BUILD_DIR export CC="ccache gcc" export CXX="ccache g++" -./waf configure --sdl2=$TRAVIS_BUILD_DIR/SDL2_linux --vgui=$TRAVIS_BUILD_DIR/vgui-dev --build-type=debug --enable-stb -./waf build -j2 +./waf configure --sdl2=$TRAVIS_BUILD_DIR/SDL2_linux --vgui=$TRAVIS_BUILD_DIR/vgui-dev --build-type=debug --enable-stb || die +./waf build -j2 || die # Build AppImage scripts/build_appimage.sh diff --git a/scripts/build_mingw_engine.sh b/scripts/build_mingw_engine.sh index e81c3b6e..78b7a6d6 100755 --- a/scripts/build_mingw_engine.sh +++ b/scripts/build_mingw_engine.sh @@ -1,5 +1,7 @@ #!/bin/bash +. scripts/lib.sh + # Build engine cd $TRAVIS_BUILD_DIR export CC="ccache i686-w64-mingw32-gcc" @@ -7,8 +9,8 @@ export CXX="ccache i686-w64-mingw32-g++" export CFLAGS="-static-libgcc -no-pthread" export CXXFLAGS="-static-libgcc -static-libstdc++" export WINRC="i686-w64-mingw32-windres" -./waf configure -o build-mingw --sdl2=$TRAVIS_BUILD_DIR/SDL2_mingw/i686-w64-mingw32/ --disable-vgui --build-type=debug --verbose # can't compile VGUI support on MinGW, due to differnet C++ ABI -./waf build -o build-mingw -j2 --verbose +./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 cp $TRAVIS_BUILD_DIR/SDL2_mingw/i686-w64-mingw32//bin/SDL2.dll . # Install SDL2 cp vgui_support_bin/vgui_support.dll . cp build-mingw/engine/xash.dll . diff --git a/scripts/build_osx_engine.sh b/scripts/build_osx_engine.sh index d0ff01f9..0555ea92 100755 --- a/scripts/build_osx_engine.sh +++ b/scripts/build_osx_engine.sh @@ -1,5 +1,7 @@ #!/bin/bash +. scripts/lib.sh + # Build engine cd $TRAVIS_BUILD_DIR @@ -7,8 +9,8 @@ export CC="/usr/bin/clang" export CXX="/usr/bin/clang++" export CFLAGS="-m32" export CXXFLAGS="-m32" -python waf configure --sdl2=~/Library/Frameworks/SDL2.framework/ --vgui=$TRAVIS_BUILD_DIR/vgui-dev --build-type=debug -python waf build -j2 +python waf configure --sdl2=~/Library/Frameworks/SDL2.framework/ --vgui=$TRAVIS_BUILD_DIR/vgui-dev --build-type=debug || die +python waf build -j2 || die # mkdir -p pkg/ # cp engine/libxash.dylib game_launch/xash3d mainui/libxashmenu.dylib vgui_support/libvgui_support.dylib VGUI/vgui-dev-master/lib/vgui.dylib ../scripts/xash3d.sh # pkg/ # cp ~/Library/Frameworks/SDL2.framework/SDL2 pkg/libSDL2.dylib diff --git a/scripts/lib.sh b/scripts/lib.sh new file mode 100644 index 00000000..ee1bebd0 --- /dev/null +++ b/scripts/lib.sh @@ -0,0 +1,5 @@ +die() +{ + cat build/config.log + exit 1 +}