version: 3.3.0.{build}

branches:
  only:
  - cpp_master

image:
- Visual Studio 2015
environment:
  global:
    BOOST_ROOT: C:\Libraries\boost_1_67_0
  matrix:
    - cpp11: -DMSGPACK_CXX11=OFF
      example:  -DMSGPACK_BUILD_EXAMPLES=OFF
      msvc: '"Visual Studio 10 2010"'
    - cpp11: -DMSGPACK_CXX11=OFF
      example:  -DMSGPACK_BUILD_EXAMPLES=OFF
      msvc: '"Visual Studio 11 2012"'
    - cpp11: -DMSGPACK_CXX11=OFF
      example:  -DMSGPACK_BUILD_EXAMPLES=OFF
      msvc: '"Visual Studio 12 2013"'
    - cpp11: -DMSGPACK_CXX11=ON
      example:  -DMSGPACK_BUILD_EXAMPLES=ON
      msvc: '"Visual Studio 14 2015"'
    - cpp11: -DMSGPACK_CXX11=OFF
      example:  -DMSGPACK_BUILD_EXAMPLES=ON
      msvc: '"Visual Studio 14 2015"'
build_script:
  - ps: |
      appveyor DownloadFile https://github.com/google/googletest/archive/release-1.7.0.zip -FileName googletest-release-1.7.0.zip
      7z x googletest-release-1.7.0.zip 2> $null
      cd googletest-release-1.7.0
      md build
      cd build
      cmake -G $env:msvc -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_FLAGS=/D_VARIADIC_MAX=10 ..
      cmake --build . --config Release
      cd ..
      cd ..
      appveyor DownloadFile http://zlib.net/zlib-1.2.11.tar.gz -FileName zlib-1.2.11.tar.gz
      7z x zlib-1.2.11.tar.gz 2> $null
      7z x zlib-1.2.11.tar 2> $null
      cd zlib-1.2.11
      md build
      cd build
      cmake -G $env:msvc ..
      cmake --build . --config Release
      copy zconf.h ..
      cd ..
      cd ..
      if ($env:msvc -ne '"Visual Studio 14 2015"') {
        ((Get-Content CMakeLists.txt) -replace "COMPONENTS chrono system OPTIONAL_COMPONENTS timer", "") | Set-Content -Path CMakeLists.txt
      }
      md build
      cd build
      cmake -G $env:msvc $env:cpp11 $env:example $env:x3_parse -DGTEST_LIBRARY="$env:APPVEYOR_BUILD_FOLDER\googletest-release-1.7.0\build\Release\gtest.lib" -DGTEST_MAIN_LIBRARY="$env:APPVEYOR_BUILD_FOLDER\googletest-release-1.7.0\build\Release\gtest_main.lib" -DGTEST_INCLUDE_DIR="$env:APPVEYOR_BUILD_FOLDER\googletest-release-1.7.0\include" -DZLIB_LIBRARY="$env:APPVEYOR_BUILD_FOLDER\zlib-1.2.11\build\Release\zlib.lib" -DZLIB_INCLUDE_DIR="$env:APPVEYOR_BUILD_FOLDER\zlib-1.2.11" -DCMAKE_CXX_FLAGS='"/D_VARIADIC_MAX=10 /EHsc"' ..
      cmake --build . --config Release -v

test_script:
- set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\googletest-release-1.7.0\build\Release;%APPVEYOR_BUILD_FOLDER%\zlib-1.2.11\build\Release;%APPVEYOR_BUILD_FOLDER%\build\release
- ctest -V
