From d28b4b900e47f0d5144182d16097dfd035a4203a Mon Sep 17 00:00:00 2001
From: Isaac Nickaein <nickaein.i@gmail.com>
Date: Tue, 21 May 2019 17:26:30 +0430
Subject: [PATCH] Add a separate build with Windows.h included

---
 appveyor.yml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/appveyor.yml b/appveyor.yml
index 9ecbabed..038d282d 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -37,6 +37,13 @@ environment:
       LINKER_FLAGS: ""
       GENERATOR: Visual Studio 14 2015
 
+    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
+      platform: x86
+      name: with_win_header
+      CXX_FLAGS: ""
+      LINKER_FLAGS: ""
+      GENERATOR: Visual Studio 14 2015
+
     - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
       platform: x86
       CXX_FLAGS: ""
@@ -81,6 +88,9 @@ install:
   - if "%COMPILER%"=="mingw" g++ --version
 
 before_build:
+  # for with_win_header build, inject the inclusion of Windows.h to the single-header library
+  - ps: if ($env:name -Eq "with_win_header") { $header_path = "single_include\nlohmann\json.hpp" }
+  - ps: if ($env:name -Eq "with_win_header") { "#include <Windows.h>`n" + (Get-Content $header_path | Out-String) | Set-Content $header_path }
   - cmake . -G "%GENERATOR%" -DCMAKE_BUILD_TYPE="%configuration%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin"
 
 build_script: