From af6cbeb17004c140ad3cfe3dec8174790138e496 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Wed, 30 Oct 2024 11:25:17 -0700 Subject: [PATCH] Enable C++17 standard in AppVeyor tests To avoid increasing the build matrix we enable this unconditionally for VS2019 and VS2022 to be able to test std::string_view. Note that we already test VS2022 without this flag on GHA so this should catch any regressions. --- tests/autotest-appveyor.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/autotest-appveyor.ps1 b/tests/autotest-appveyor.ps1 index 26d8e81..68d39be 100644 --- a/tests/autotest-appveyor.ps1 +++ b/tests/autotest-appveyor.ps1 @@ -37,6 +37,8 @@ foreach ($vs in $args) if (! $?) { throw "Error setting up VS$vs $arch" } + $cxx = if ($vs -ge 19) { "/std:c++17" } else { "" } + foreach ($defines in "standard", "PUGIXML_WCHAR_MODE", "PUGIXML_COMPACT") { $target = "tests_vs${vs}_${arch}_${defines}" @@ -45,7 +47,7 @@ foreach ($vs in $args) Add-AppveyorTest $target -Outcome Running Write-Output "# Building $target.exe" - & cmd /c "cl.exe /MP /Fe$target.exe /EHsc /W4 /WX $deflist $sources 2>&1" | Tee-Object -Variable buildOutput + & cmd /c "cl.exe /MP /Fe$target.exe /EHsc /W4 /WX $cxx $deflist $sources 2>&1" | Tee-Object -Variable buildOutput if ($?) {