language: cpp
sudo: true

matrix:
  include:
    - os: linux
      env: CXXFLAGS="-std=c++11 -Wall -Wextra -Wpedantic -Wshadow"
    - os: osx
      env: CXXFLAGS="-std=c++11 -Wall -Wextra -Wpedantic -Wshadow"

install:
  # install latest cmake
  - |
    if [ "$TRAVIS_OS_NAME" == "linux" ]; then
      CMAKE_URL="https://cmake.org/files/v3.11/cmake-3.11.1-Linux-x86_64.tar.gz";
      mkdir cmake_latest && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake_latest;
      export PATH=$(pwd)/cmake_latest/bin:${PATH};
    fi

  - |
    if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
      brew update;
      brew uninstall cmake;
      brew install cmake;
    fi
  - which ${CC}
  - which ${CXX}
  - which cmake

script:
  - mkdir tinyply_build
  - cd tinyply_build
  - cmake ..
  - cmake --build .
