language: cpp
env:
  global:
    - E2D_WITHOUT_AUDIO=true
    - E2D_WITHOUT_GRAPHICS=true
matrix:
  include:
    - os: linux
      dist: trusty
      addons: { apt: { sources: ubuntu-toolchain-r-test, packages: ["xorg-dev", "g++-7"] } }
      env: MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
    - os: linux
      dist: trusty
      addons: { apt: { sources: ubuntu-toolchain-r-test, packages: ["xorg-dev", "g++-8"] } }
      env: MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
    - os: linux
      dist: trusty
      addons: { apt: { sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-5.0"], packages: ["xorg-dev", "clang-5.0", "g++-7"] } }
      env: MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0"
    - os: linux
      dist: trusty
      addons: { apt: { sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-6.0"], packages: ["xorg-dev", "clang-6.0", "g++-7"] } }
      env: MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0"
    - os: linux
      dist: trusty
      addons: { apt: { sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-7"], packages: ["xorg-dev", "clang-7", "g++-7"] } }
      env: MATRIX_EVAL="CC=clang-7 && CXX=clang++-7"
    - os: linux
      dist: trusty
      addons: { apt: { sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-8"], packages: ["xorg-dev", "clang-8", "g++-7"] } }
      env: MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
    - os: osx
      osx_image: xcode10
      compiler: clang
      addons: { homebrew: { packages: ["lcov"] } }
      after_success: ./scripts/upload_coverage.sh
before_install:
  - eval "${MATRIX_EVAL}"
  - if [ "$TRAVIS_OS_NAME" == 'osx' ]; then
    brew update;
    brew upgrade cmake;
    brew install git-lfs;
    fi
  - if [ "$TRAVIS_OS_NAME" == 'linux' ]; then
    mkdir $HOME/cmake;
    export PATH="$HOME/cmake/bin:$PATH";
    travis_retry wget -q https://cmake.org/files/v3.11/cmake-3.11.4-Linux-x86_64.sh;
    sh cmake-3.11.4-Linux-x86_64.sh --prefix=$HOME/cmake --exclude-subdir --skip-license;
    fi
before_script:
  - git submodule update --init --recursive
  - git lfs install
  - git lfs pull
script:
  - ./scripts/build_all.sh
