language: generic

dist: trusty
sudo: required

cache:
    apt: true

matrix:
    include:
    - env: CXX=g++-6 CC=gcc-6
      addons:
        apt:
          packages:
            - g++-6
          sources: &sources
            - ubuntu-toolchain-r-test
            - llvm-toolchain-precise
            - llvm-toolchain-precise-3.8
            - llvm-toolchain-precise-3.7
            - llvm-toolchain-precise-3.6
            - sourceline: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main'
              key_url: 'http://apt.llvm.org/llvm-snapshot.gpg.key'
    - env: CXX=g++-5 CC=gcc-5
      addons:
        apt:
          packages:
            - g++-5
          sources: *sources
    - env: CXX=clang++-3.9 CC=clang-3.9
      addons:
        apt:
          packages:
            - clang-3.9
          sources: *sources
    - env: CXX=clang++-3.8 CC=clang-3.8
      addons:
        apt:
          packages:
            - clang-3.8
          sources: *sources
    - env: CXX=clang++-3.7 CC=clang-3.7
      addons:
        apt:
          packages:
            - clang-3.7
          sources: *sources
    - env: CXX=clang++-3.6 CC=clang-3.6
      addons:
        apt:
          packages:
            - clang-3.6
          sources: *sources

script:
    - mkdir build && cd build
    - cmake ..
    - make
    - ctest -V


language: generic

cache:
  apt: true

addons:
  apt:
    sources: &sources
      - ubuntu-toolchain-r-test
      - llvm-toolchain-precise
      - llvm-toolchain-precise-3.6
      - llvm-toolchain-precise-3.8

matrix:
  include:
    - env: CC=gcc-6 CXX=g++-6
      os: linux
      dist: trusty
      sudo: require
      addons:
        apt:
          sources: *sources
          packages:
            - gcc-6
            - g++-6

    - env: CC=gcc-5 CXX=g++-5
      os: linux
      dist: trusty
      sudo: require
      addons:
        apt:
          sources: *sources
          packages:
            - gcc-5
            - g++-5

    - env: CC=clang-3.8 CXX=clang++-3.8
      os: linux
      dist: trusty
      sudo: require
      addons:
        apt:
          sources: *sources
          packages:
            - g++-6 # Hack to make clang work.
            - clang-3.8

    - env: CC=clang-3.6 CXX=clang++-3.6
      os: linux
      dist: trusty
      sudo: require
      addons:
        apt:
          sources: *sources
          packages:
            - clang-3.6

    - os: osx
      osx_image: xcode8.2
      before_install:
        - brew update
        - brew install --overwrite cmake

script:
    - mkdir build && cd build
    - cmake ..
    - cmake --build . --config debug
    - ctest -V -C debug

Simplify the CI and add OSX to build.
Simplify the CI and add OSX to build.
