language: cpp

compiler:
  - gcc
  - clang

env:
  - CMAKE_BUILD_TYPE=Debug
  - CMAKE_BUILD_TYPE=Release

before_install:
  # CMake 3.x
  - sudo dpkg -r cmake cmake-data
  - sudo add-apt-repository -y ppa:dcthomp/smtk

  # gcc-4.9
  - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test

  # clang 3.4
  - if [ "$CC" == "clang" ]; then sudo add-apt-repository -y ppa:h-rayflood/llvm; fi

  - sudo apt-get update -qq

install:
  # CMake and ninja
  - sudo apt-get install ninja-build cmake
  - cmake --version
  - ninja --version

  # g++-4.9, also needed for Clang since we need a newer version of libstc++
  - sudo apt-get install -qq g++-4.9

  # Also use it if that's what we're going for
  - if [ "$CC" = "gcc" ]; then
      export CC=gcc-4.9 &&
      export CXX="g++-4.9";
    fi

  # clang 3.4
  - if [ "$CC" == "clang" ]; then
      sudo apt-get install --allow-unauthenticated -qq clang-3.4 &&
      export CC=clang-3.4 &&
      export CXX=clang++-3.4;
    fi

script:
  - mkdir build && cd build
  - cmake -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DRC_ENABLE_TESTS=ON -DRC_ENABLE_EXAMPLES=ON -DRC_ENABLE_GTEST=ON -DRC_ENABLE_GMOCK=ON -DRC_ENABLE_BOOST=ON -DRC_ENABLE_BOOST_TEST=ON -G Ninja ..
  - ninja -j1 # Don't run out of memory, please
  - ctest --output-on-failure
language: cpp
sudo: false

compiler:
  - gcc
  - clang

env:
  - CMAKE_BUILD_TYPE=Debug
  - CMAKE_BUILD_TYPE=Release

addons:
  apt:
    sources:
    # CMake 3.x
    - george-edison55-precise-backports
    # gcc-4.9
    - ubuntu-toolchain-r-test
    # clang 3.4
    - llvm-toolchain-precise
    packages:
    - cmake
    - cmake-data
    - ninja-build
    - g++-4.9
    - clang-3.4

install:
  # Use GCC 4.9
  - if [ "$CC" = "gcc" ]; then
      export CC=gcc-4.9 &&
      export CXX="g++-4.9";
    fi

script:
  - mkdir build && cd build
  - cmake -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DRC_ENABLE_TESTS=ON -DRC_ENABLE_EXAMPLES=ON -DRC_ENABLE_GTEST=ON -DRC_ENABLE_GMOCK=ON -DRC_ENABLE_BOOST=ON -DRC_ENABLE_BOOST_TEST=ON -G Ninja ..
  - ninja -j1 # Don't run out of memory, please
  - ctest --output-on-failure
Switch to Travis container based infrastructure
Switch to Travis container based infrastructure
