diff --git a/.travis.yml b/.travis.yml index 0e1ad6a..436e037 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,35 +1,29 @@ -# Build matrix / environment variable are explained on: +# Build matrix / environment variables are explained on: # http://about.travis-ci.org/docs/user/build-configuration/ # This file can be validated on: http://lint.travis-ci.org/ -dist: xenial language: cpp +dist: xenial +osx_image: xcode10.2 compiler: - - gcc - - clang +- gcc +- clang os: - - linux - - osx +- linux +- osx env: - - BUILD_TYPE=Debug - - BUILD_TYPE=RelWithDebInfo - -matrix: - exclude: - # GCC fails on recent Travis OSX images. - # https://github.com/travis-ci/travis-ci/issues/9640 - - compiler: gcc - os: osx +- BUILD_TYPE=Debug +- BUILD_TYPE=RelWithDebInfo addons: apt: sources: - - llvm-toolchain-xenial-7 + - llvm-toolchain-xenial-8 - ubuntu-toolchain-r-test packages: - - clang-7 + - clang-8 - cmake - gcc-8 - g++-8 @@ -40,24 +34,33 @@ addons: - ninja-build homebrew: packages: + - cmake - crc32c + - gcc@8 - gperftools - kyotocabinet - - gcc@7 + - llvm@8 - ninja - snappy - sqlite3 - -before_install: -# The Travis VM image for Mac already has a link at /usr/local/include/c++, -# causing Homebrew's gcc installation to error out. This was reported to -# Homebrew maintainers at https://github.com/Homebrew/brew/issues/1742 and -# removing the link emerged as a workaround. -- if [ "$TRAVIS_OS_NAME" == "osx" ]; then rm -f /usr/local/include/c++ ; fi + update: true install: -# /usr/bin/gcc is stuck to old versions on both Linux and OSX. +# The following Homebrew packages aren't linked by default, and need to be +# prepended to the path explicitly. +- if [ "$TRAVIS_OS_NAME" == "osx" ]; then + export PATH="$(brew --prefix llvm)/bin:$PATH"; + fi +# /usr/bin/gcc points to an older compiler on both Linux and macOS. - if [ "$CXX" = "g++" ]; then export CXX="g++-8" CC="gcc-8"; fi +# /usr/bin/clang points to an older compiler on both Linux and macOS. +# +# Homebrew's llvm package doesn't ship a versioned clang++ binary, so the values +# below don't work on macOS. Fortunately, the path change above makes the +# default values (clang and clang++) resolve to the correct compiler on macOS. +- if [ "$TRAVIS_OS_NAME" == "linux" ]; then + if [ "$CXX" = "clang++" ]; then export CXX="clang++-8" CC="clang-8"; fi; + fi - echo ${CC} - echo ${CXX} - ${CXX} --version