language: cpp

matrix:
  include:
    - os: linux
      compiler: gcc
    - os: linux
      compiler: clang
    - os: osx
      compiler: clang
    - os: windows
      env:
        - TARGET="Visual Studio 15 2017"
    - os: windows
      env:
        - TARGET="Visual Studio 15 2017 Win64"

script:
  - if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then make config=coverage test; fi
  - if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then make config=sanitize test; fi
  - if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then make config=release test; fi
  - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then cmake -G "$TARGET" -DBUILD_DEMO=ON; fi
  - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then cmake --build . -- -verbosity:minimal; fi
  - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then ./Debug/demo.exe demo/pirate.obj; fi

after_script:
  - if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then bash <(curl -s https://codecov.io/bash); fi

language: cpp

matrix:
  include:
    - os: linux
      compiler: gcc
    - os: linux
      compiler: clang
    - os: osx
      compiler: clang
    - os: windows
      env:
        - TARGET="Visual Studio 15 2017"
    - os: windows
      env:
        - TARGET="Visual Studio 15 2017 Win64"

script:
  - if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then make config=coverage test; fi
  - if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then make config=sanitize test; fi
  - if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then make config=release test; fi
  - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then cmake -G "$TARGET" -DBUILD_DEMO=ON; fi
  - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then msbuild meshoptimizer.sln /p:Configuration=Debug /v:minimal && ./Debug/demo.exe demo/pirate.obj; fi
  - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then msbuild meshoptimizer.sln /p:Configuration=Release /v:minimal && ./Release/demo.exe demo/pirate.obj; fi

after_script:
  - if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then bash <(curl -s https://codecov.io/bash); fi

Build both Debug and Release builds on Windows CI
Build both Debug and Release builds on Windows CI

We've had issues in the past where Release builds wouldn't compile on
MSVC due to assertions being compiled out; we now compile and run both
Debug and Release.
