language: cpp

compiler: gcc

before_install:
  - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
  - sudo apt-get update -qq
  - sudo apt-get install -y build-essential
  - sudo apt-get install -y cmake libboost-date-time-dev libboost-thread-dev libboost-system-dev
  - sudo apt-get install -y libportmidi-dev libsqlite3-0 libsqlite3-dev
  - sudo apt-get install -y libfreetype6-dev libpng++-dev zlib1g-dev libwxgtk3.0-dev
  - sudo apt-get install -y libunittest++-dev
  - if [ "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi
addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - gcc-4.9
      - g++-4.9

script:
  - mkdir build
  - cd build
  - cmake -G "Unix Makefiles"  ..
  - make
  - ./bin/testlib

sudo: false
dist: trusty
language: cpp

matrix:
  include:

    - os: linux
      env:
        - COMPILER=gcc-4.9 
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-4.9
            - cmake
            - libfreetype6-dev
            - libpng++-dev
            - zlib1g-dev
            - libunittest++-dev

    - os: linux
      env:
        - COMPILER=gcc-4.9 
        - CXXFLAGS="-D_GLIBCXX_DEBUG"
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-4.9
            - cmake
            - libfreetype6-dev
            - libpng++-dev
            - zlib1g-dev
            - libunittest++-dev

    - os: linux
      env:
        - COMPILER=gcc-7
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-7
            - cmake
            - libfreetype6-dev
            - libpng++-dev
            - zlib1g-dev
            - libunittest++-dev

    - os: linux
      env:
        - COMPILER=gcc-7
        - CXXFLAGS="-D_GLIBCXX_DEBUG"
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-7
            - cmake
            - libfreetype6-dev
            - libpng++-dev
            - zlib1g-dev
            - libunittest++-dev

    - os: osx
      env:
        - COMPILER=clang 
      install:
        - brew install unittest-cpp

script:
  - export CC=$COMPILER
  - export CXX=${CC/gcc/g++}
  - export CXX=${CXX/clang/clang++}
  - $CXX --version
  - mkdir build && cd build
  - cmake -G "Unix Makefiles" ..
  - make
  - ./bin/testlib

Check with multiple compilers on Travis
Check with multiple compilers on Travis
