shallow_clone: true

image: Visual Studio 2017

platform:
  - x86
  - x64

configuration:
  - Debug
  - Release

environment:
  matrix:
    - CPP: latest

#    - CPP: 14

cache:
  - C:\ninja-1.8.2

install:
  - ps: |
      if (![IO.File]::Exists("C:\ninja-1.8.2\ninja.exe")) {
        Start-FileDownload 'https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip'
        7z x -y ninja-win.zip -oC:\ninja-1.8.2
      }
      $env:PATH="C:\ninja-1.8.2;$env:PATH"
  - for /f "tokens=1* delims=" %%i in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath') do call "%%i\VC\Auxiliary\Build\vcvarsall.bat" %PLATFORM:x86=x64_x86%
  - cmake --version
  - ninja --version
  - clang-cl --version

build_script:
  - mkdir build && cd build
  - ps: |
      $env:CC='clang-cl'
      $env:CXX='clang-cl'
      $env:HEADER_CHECK=0
      if ($env:PLATFORM -eq "x64") {
        if ($env:CONFIGURATION -eq "Debug") {
          $env:HEADER_CHECK=1
        }
      } else {
        $env:CXXFLAGS='-m32'
        $env:CFLAGS='-m32'
      }
  - cmake .. -G Ninja -Wdev -DRANGE_V3_HEADER_CHECKS=%HEADER_CHECK% -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DRANGES_CXX_STD=%CPP%
  - ninja -v

test_script:
  - ctest -j2 --output-on-failure

deploy: off
