Skip to content

Commit

Permalink
ci:travis ci: Use ccache and add gcc 6 build config
Browse files Browse the repository at this point in the history
Also make the build noisier to prevent some build failures when download
speeds are slow from whatever repository.

Note: The 64-bit devel build currently doesn't benefit from ccache for
whatever reason.

[skip appveyor]
  • Loading branch information
turtleli committed May 16, 2016
1 parent 37c0494 commit df5035d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 7 deletions.
17 changes: 12 additions & 5 deletions .travis.yml
Expand Up @@ -3,24 +3,31 @@ language: cpp
sudo: required
dist: trusty

cache: ccache

matrix:
include:
# Version 5 seems to be whatever is latest - for now it's 5.3
- env: VERSION=6 BITS=32
compiler: gcc-6-32
os: linux
- env: VERSION=5 BITS=32
compiler: gcc
compiler: gcc-5-32
os: linux
- env: VERSION=4.9 BITS=32
compiler: gcc
compiler: gcc-4.9-32
os: linux
- env: VERSION=3.7 BITS=32
compiler: clang
compiler: clang-3.7-32
os: linux
- env: VERSION=4.9 BITS=64
compiler: gcc
compiler: gcc-4.9-64
os: linux

before_install:
- ./travis.sh before_install

script:
- ./travis.sh script

after_success:
- ./travis.sh after_success
31 changes: 29 additions & 2 deletions travis.sh
Expand Up @@ -30,7 +30,7 @@ linux_32_before_install() {
# build image. libgtk2.0-dev:i386 and libsdl2-dev:i386 require the 32-bit
# versions of the dependencies, and the 2 versions conflict. So those
# dependencies must be explicitly installed.
sudo apt-get -qq -y install \
sudo apt-get -y install \
gir1.2-freedesktop:i386 \
gir1.2-gdkpixbuf-2.0:i386 \
gir1.2-glib-2.0:i386 \
Expand All @@ -51,12 +51,22 @@ linux_32_before_install() {
portaudio19-dev:i386 \
zlib1g-dev:i386 \
${COMPILER_PACKAGE}

# Manually add ccache symlinks for clang
if [ "${CXX}" = "clang++" ]; then
sudo ln -sf ../../bin/ccache /usr/lib/ccache/${CXX}-${VERSION}
sudo ln -sf ../../bin/ccache /usr/lib/ccache/${CC}-${VERSION}
fi
}

linux_32_script() {
mkdir build
cd build

# Prevents warning spam
if [ "${CXX}" = "clang++" ]; then
export CCACHE_CPP2=yes
fi
export CC=${CC}-${VERSION} CXX=${CXX}-${VERSION}
cmake \
-DCMAKE_TOOLCHAIN_FILE=cmake/linux-compiler-i386-multilib.cmake \
Expand Down Expand Up @@ -86,7 +96,7 @@ linux_64_before_install() {

# libgl1-mesa-dev, liblzma-dev, libxext-dev, zlib1g-dev already installed on
# build worker, I put these here in case the build image changes.
sudo apt-get -qq -y install \
sudo apt-get -y install \
libaio-dev \
libasound2-dev \
libgtk2.0-dev \
Expand All @@ -96,13 +106,23 @@ linux_64_before_install() {
libwxgtk3.0-dev \
portaudio19-dev \
${COMPILER_PACKAGE}

# Manually add ccache symlinks for clang
if [ "${CXX}" = "clang++" ]; then
sudo ln -sf ../../bin/ccache /usr/lib/ccache/${CXX}-${VERSION}
sudo ln -sf ../../bin/ccache /usr/lib/ccache/${CC}-${VERSION}
fi
}


linux_64_script() {
mkdir build
cd build

# Prevents warning spam
if [ "${CXX}" = "clang++" ]; then
export CCACHE_CPP2=yes
fi
export CC=${CC}-${VERSION} CXX=${CXX}-${VERSION}
cmake \
-DCMAKE_BUILD_TYPE=Devel \
Expand All @@ -114,11 +134,18 @@ linux_64_script() {
make -j3 install
}

linux_after_success() {
ccache -s
}

# Just in case I do manual testing and accidentally insert "rm -rf /"
case "${1}" in
before_install|script)
${TRAVIS_OS_NAME}_${BITS}_${1}
;;
after_success)
${TRAVIS_OS_NAME}_${1}
;;
*)
echo "Unknown command" && false
;;
Expand Down

1 comment on commit df5035d

@gregory38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: The 64-bit devel build currently doesn't benefit from ccache for
whatever reason.

Could be -march=native, if the vm doesn't provide the same CPU. Could be safer to disable simd stuff.

Please sign in to comment.