# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Copyright Mathieu Champlon 2015.
# Copyright Alexander Grund 2020.

skip_branch_with_pr: true

branches:
  only:
    - master

environment:
  matrix:
    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
      BOOST: 1_60_0
      TOOLSET: msvc-14.0
    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
      BOOST: 1_65_1
      TOOLSET: msvc-14.1
      CXX_STANDARD: 14
    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
      BOOST: 1_67_0
      TOOLSET: msvc-14.1
      CXX_STANDARD: 14
      # CXX_STANDARD: 17
    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
      BOOST: 1_60_0
      CMAKE: true
    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
      BOOST: 1_71_0
      CMAKE: true

install:
  - cd %APPVEYOR_BUILD_FOLDER%\doc
  - appveyor-retry powershell Invoke-WebRequest ftp://ftp.zlatkovic.com/libxml/iconv-1.9.2.win32.zip -OutFile iconv.zip
  - 7z e iconv.zip iconv.dll -r
  - appveyor-retry powershell Invoke-WebRequest ftp://ftp.zlatkovic.com/libxml/libxml2-2.7.8.win32.zip -OutFile libxml2.zip
  - 7z e libxml2.zip libxml2.dll -r
  - appveyor-retry powershell Invoke-WebRequest ftp://ftp.zlatkovic.com/libxml/libxslt-1.1.26.win32.zip -OutFile libxslt.zip
  - 7z e libxslt.zip libexslt.dll libxslt.dll xsltproc.exe -r
  - appveyor-retry powershell Invoke-WebRequest ftp://ftp.zlatkovic.com/libxml/zlib-1.2.5.win32.zip -OutFile zlib.zip
  - 7z e zlib.zip zlib1.dll -r
  - xsltproc -V

build_script:
  - set BOOST_ROOT=C:\Libraries\boost_%BOOST%
  - cd %BOOST_ROOT%
  - call bootstrap.bat
  - cd %APPVEYOR_BUILD_FOLDER%\build
  - if NOT "%CXX_STANDARD%"=="" set CXX_FLAGS=cxxflags=/std:c++%CXX_STANDARD%
  - set BUILD_ARGS=address-model=32,64 variant=debug,release
  - call build.bat --toolset=%TOOLSET% %CXX_FLAGS% -j3

for:
  - matrix:
      only: [CMAKE: true]
    install: true
    build_script:
      - set BOOST_ROOT=C:\Libraries\boost_%BOOST%
      - cd %APPVEYOR_BUILD_FOLDER%
      - mkdir __build
      - cd __build
      - cmake .. -DCMAKE_BUILD_TYPE=Debug
      - cmake --build . --config Debug
      - ctest --output-on-failure --build-config Debug