Skip to content

Commit

Permalink
Travis: More compiler variants
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Kretz <kretz@kde.org>
  • Loading branch information
mattkretz committed Jan 19, 2017
1 parent 08ac7ad commit dcd4f79
Showing 1 changed file with 57 additions and 33 deletions.
90 changes: 57 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ language: cpp
cache: ccache

env:
- GCC_VERSION=5
- GCC_VERSION=default
- CXX_VERSION=current
- CXX_VERSION=previous
- CXX_VERSION=default

os:
- linux
Expand All @@ -16,45 +17,68 @@ compiler:

matrix:
exclude:
- env: GCC_VERSION=5
- env: CXX_VERSION=previous
os: osx
compiler: clang
- env: GCC_VERSION=5
os: linux
compiler: clang

# The following gives us Ubuntu 14.04 LTS instead of 12.04 LTS
sudo: required
dist: trusty

install:
- if test "$TRAVIS_OS_NAME" = "osx" -a "$CXX" = "g++"; then
brew update &&
if test $GCC_VERSION = 5; then
brew install gcc5 && export CXX=g++-5 CC=gcc-5;
else
export CXX=g++-4.9 CC=gcc-4.9;
fi
fi
- if test "$TRAVIS_OS_NAME" = "osx" -a "$CXX" = "clang++"; then
brew update &&
brew install llvm &&
export CXX=/usr/local/opt/llvm/bin/clang++ CC=/usr/local/opt/llvm/bin/clang &&
export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib" &&
export CPPFLAGS=-I/usr/local/opt/llvm/include;
fi
- if test "$TRAVIS_OS_NAME" = "linux" -a "$GCC_VERSION" = "5"; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y &&
sudo apt-get update -q &&
sudo apt-get install g++-5 -y &&
export CXX=g++-5 CC=gcc-5;
fi
- if test "$TRAVIS_OS_NAME" = "linux" -a "$CXX" = "clang++"; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y &&
sudo apt-get update -q &&
sudo apt-get install clang-3.8 libstdc++-6-dev libc++-dev libc++abi-dev -y;
export CXX=clang++-3.8 CC=clang-3.8;
fi
- case "$TRAVIS_OS_NAME-$CXX-$CXX_VERSION" in
linux-g++-current)
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y &&
sudo apt-get update -q &&
sudo apt-get install g++-6 -y &&
export CXX=g++-6 CC=gcc-6;;
linux-g++-previous)
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y &&
sudo apt-get update -q &&
sudo apt-get install g++-5 -y &&
export CXX=g++-5 CC=gcc-5;;
linux-g++-default)
;;
linux-clang++-current)
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y &&
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - &&
sudo tee /etc/apt/sources.list.d/llvm.list <<< "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-4.0 main" &&
sudo apt-get update -q &&
sudo apt-get install clang-4.0 -y &&
export CXX=clang++-4.0 CC=clang-4.0;;
linux-clang++-previous)
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y &&
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - &&
sudo tee /etc/apt/sources.list.d/llvm.list <<< "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main" &&
sudo apt-get update -q &&
sudo apt-get install clang-3.9 -y &&
export CXX=clang++-3.9 CC=clang-3.9;;
linux-clang++-default)
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y &&
sudo apt-get update -q &&
sudo apt-get install clang-3.8 libstdc++-6-dev libc++-dev libc++abi-dev -y &&
export CXX=clang++-3.8 CC=clang-3.8;;
osx-g++-current)
brew update &&
brew install gcc6 &&
export CXX=g++-6 CC=gcc-6;;
osx-g++-previous)
brew update &&
brew install gcc5 &&
export CXX=g++-5 CC=gcc-5;;
osx-g++-default)
export CXX=g++-4.9 CC=gcc-4.9;;
osx-clang++-current)
brew update &&
brew install llvm &&
export CXX=/usr/local/opt/llvm/bin/clang++ CC=/usr/local/opt/llvm/bin/clang &&
export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib" &&
export CPPFLAGS=-I/usr/local/opt/llvm/include;;
osx-clang++-previous)
exit 1;;
osx-clang++-default)
;;
esac

before_script:
- $CXX --version
Expand Down

0 comments on commit dcd4f79

Please sign in to comment.