1c5f01b2fSopenharmony_civersion: '{build}'
2c5f01b2fSopenharmony_ci
3c5f01b2fSopenharmony_cienvironment:
4c5f01b2fSopenharmony_ci  matrix:
5c5f01b2fSopenharmony_ci    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
6c5f01b2fSopenharmony_ci      configuration: Debug
7c5f01b2fSopenharmony_ci      platform: x86
8c5f01b2fSopenharmony_ci      CXX_FLAGS: "/W4 /WX"
9c5f01b2fSopenharmony_ci      CMAKE_OPTIONS: ""
10c5f01b2fSopenharmony_ci      GENERATOR: Visual Studio 14 2015
11c5f01b2fSopenharmony_ci
12c5f01b2fSopenharmony_ci    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
13c5f01b2fSopenharmony_ci      configuration: Release
14c5f01b2fSopenharmony_ci      platform: x86
15c5f01b2fSopenharmony_ci      CXX_FLAGS: "/W4 /WX"
16c5f01b2fSopenharmony_ci      CMAKE_OPTIONS: ""
17c5f01b2fSopenharmony_ci      GENERATOR: Visual Studio 14 2015
18c5f01b2fSopenharmony_ci
19c5f01b2fSopenharmony_ci    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
20c5f01b2fSopenharmony_ci      configuration: Release
21c5f01b2fSopenharmony_ci      platform: x86
22c5f01b2fSopenharmony_ci      name: with_win_header
23c5f01b2fSopenharmony_ci      CXX_FLAGS: "/W4 /WX"
24c5f01b2fSopenharmony_ci      CMAKE_OPTIONS: ""
25c5f01b2fSopenharmony_ci      GENERATOR: Visual Studio 14 2015
26c5f01b2fSopenharmony_ci
27c5f01b2fSopenharmony_ci    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
28c5f01b2fSopenharmony_ci      configuration: Release
29c5f01b2fSopenharmony_ci      platform: x86
30c5f01b2fSopenharmony_ci      CXX_FLAGS: "/permissive- /std:c++latest /utf-8 /W4 /WX"
31c5f01b2fSopenharmony_ci      CMAKE_OPTIONS: ""
32c5f01b2fSopenharmony_ci      GENERATOR: Visual Studio 15 2017
33c5f01b2fSopenharmony_ci
34c5f01b2fSopenharmony_ci    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
35c5f01b2fSopenharmony_ci      configuration: Release
36c5f01b2fSopenharmony_ci      platform: x86
37c5f01b2fSopenharmony_ci      CXX_FLAGS: "/W4 /WX"
38c5f01b2fSopenharmony_ci      CMAKE_OPTIONS: "-DJSON_ImplicitConversions=OFF"
39c5f01b2fSopenharmony_ci      GENERATOR: Visual Studio 16 2019
40c5f01b2fSopenharmony_ci
41c5f01b2fSopenharmony_ci    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
42c5f01b2fSopenharmony_ci      configuration: Release
43c5f01b2fSopenharmony_ci      platform: x64
44c5f01b2fSopenharmony_ci      CXX_FLAGS: "/W4 /WX"
45c5f01b2fSopenharmony_ci      CMAKE_OPTIONS: ""
46c5f01b2fSopenharmony_ci      GENERATOR: Visual Studio 14 2015
47c5f01b2fSopenharmony_ci
48c5f01b2fSopenharmony_ci    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
49c5f01b2fSopenharmony_ci      configuration: Release
50c5f01b2fSopenharmony_ci      platform: x64
51c5f01b2fSopenharmony_ci      CXX_FLAGS: "/permissive- /std:c++latest /Zc:__cplusplus /utf-8 /W4 /WX"
52c5f01b2fSopenharmony_ci      CMAKE_OPTIONS: ""
53c5f01b2fSopenharmony_ci      GENERATOR: Visual Studio 15 2017
54c5f01b2fSopenharmony_ci
55c5f01b2fSopenharmony_ciinit:
56c5f01b2fSopenharmony_ci  - cmake --version
57c5f01b2fSopenharmony_ci  - msbuild /version
58c5f01b2fSopenharmony_ci
59c5f01b2fSopenharmony_ciinstall:
60c5f01b2fSopenharmony_ci  - if "%platform%"=="x86"    set GENERATOR_PLATFORM=Win32
61c5f01b2fSopenharmony_ci
62c5f01b2fSopenharmony_cibefore_build:
63c5f01b2fSopenharmony_ci  # for with_win_header build, inject the inclusion of Windows.h to the single-header library
64c5f01b2fSopenharmony_ci  - ps: if ($env:name -Eq "with_win_header") { $header_path = "single_include\nlohmann\json.hpp" }
65c5f01b2fSopenharmony_ci  - ps: if ($env:name -Eq "with_win_header") { "#include <Windows.h>`n" + (Get-Content $header_path | Out-String) | Set-Content $header_path }
66c5f01b2fSopenharmony_ci  - cmake . -G "%GENERATOR%" -A "%GENERATOR_PLATFORM%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On "%CMAKE_OPTIONS%"
67c5f01b2fSopenharmony_ci
68c5f01b2fSopenharmony_cibuild_script:
69c5f01b2fSopenharmony_ci  - cmake --build . --config "%configuration%"
70c5f01b2fSopenharmony_ci
71c5f01b2fSopenharmony_citest_script:
72c5f01b2fSopenharmony_ci  - if "%configuration%"=="Release" ctest -C "%configuration%" -V -j
73c5f01b2fSopenharmony_ci  # On Debug builds, skip test-unicode_all
74c5f01b2fSopenharmony_ci  # as it is extremely slow to run and cause
75c5f01b2fSopenharmony_ci  # occasional timeouts on AppVeyor.
76c5f01b2fSopenharmony_ci  # More info: https://github.com/nlohmann/json/pull/1570
77c5f01b2fSopenharmony_ci  - if "%configuration%"=="Debug" ctest --exclude-regex "test-unicode" -C "%configuration%" -V -j
78c5f01b2fSopenharmony_ci
79c5f01b2fSopenharmony_ci# only build PRs and commits to develop branch
80c5f01b2fSopenharmony_ci# (see https://help.appveyor.com/discussions/questions/55079-two-builds-per-commit-to-pull-request)
81c5f01b2fSopenharmony_cibranches:
82c5f01b2fSopenharmony_ci  only:
83c5f01b2fSopenharmony_ci    - develop
84