pentarctagon 1ef1704fd9 Adds the opt/OPT option to scons/cmake.
Travis now also makes use of this to set the optimization level for the -O0 builds, rather than extra_flags_*.  This additionally fixes an issue where using -O0 in the release build with LTO resulted in the individual *.o files being compiled with -O0, but LTO then still linked with release's default -O3.

(cherry-picked from commit 63ff641662d4192401a49f9a002d7872000a3f02)
2018-10-07 03:19:35 +00:00

40 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
if [ "$TOOL" = "xcodebuild" ]; then
export PATH="/usr/local/opt/ccache/libexec:$PWD/utils/travis:$PATH"
export CC=ccache-clang
export CXX=ccache-clang++
cd ./projectfiles/Xcode
export CCACHE_MAXSIZE=200M
export CCACHE_COMPILERCHECK=content
xcodebuild GCC_GENERATE_DEBUGGING_SYMBOLS=NO -project Wesnoth.xcodeproj -target Wesnoth
BUILD_RET=$?
ccache -s
ccache -z
exit $BUILD_RET
else
ln -s $HOME/build-cache/ build
./utils/travis/check_utf8.sh || exit 1
./utils/travis/utf8_bom_dog.sh || exit 1
"$CXX" --version
scons wesnoth wesnothd campaignd boost_unit_tests build=release \
ctool="$CC" cxxtool="$CXX" cxx_std="$CXXSTD" \
extra_flags_config="-pipe" opt="$OPT" strict=true \
nls="$NLS" enable_lto="$LTO" jobs=2 --debug=time
fi
else
docker run -v "$HOME"/build-cache:/home/wesnoth-travis/build \
-v "$HOME"/.ccache:/root/.ccache wesnoth-repo:"$LTS"-"$BRANCH" \
bash -c './utils/travis/docker_run.sh "$@"' \
bash "$NLS" "$TOOL" "$CC" "$CXX" "$CXXSTD" "$OPT" "$WML_TESTS" "$WML_TEST_TIME" "$PLAY_TEST" "$MP_TEST" "$BOOST_TEST" "$LTO" "$SAN"
fi