language: cpp
compiler:
  - clang
  - gcc
os:
  - linux

matrix:
  include:
    # works on Precise and Trusty
    - os: linux
      compiler: clang
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
            - llvm-toolchain-precise-3.6
          packages:
            - clang-3.6
      env:
        - MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6"

    # works on Precise and Trusty
    - os: linux
      compiler: gcc
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-4.9
      env:
        - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"

  # exclude default targets (i.e. without MATRIX_EVAL environment variables)
  exclude:
    - compiler: clang
    - compiler: gcc

before_install:
  - eval "${MATRIX_EVAL}"

script:
  - make

language: cpp
compiler:
  - clang
  - gcc
os:
  - linux
  - osx

matrix:
  include:
    # works on Precise and Trusty
    - os: linux
      compiler: clang
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
            - llvm-toolchain-precise-3.6
          packages:
            - clang-3.6
      env:
        - MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6"

    # works on Precise and Trusty
    - os: linux
      compiler: gcc
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-4.9
      env:
        - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"

    - os: osx
      compiler: clang
      osx_image: xcode8

    - os: osx
      compiler: gcc
      osx_image: xcode8
      env:
        - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"

  # exclude default targets (i.e. without MATRIX_EVAL environment variables)
  exclude:
    - compiler: clang
    - compiler: gcc

before_install:
  - eval "${MATRIX_EVAL}"

script:
  - make

Add OSX builds to Travis CI
Add OSX builds to Travis CI
