Skip to content

Commit 3480faa

Browse files
authored
Merge pull request #642 from zeux/string-view-def
Auto-detect std::string_view support by default
2 parents 781e2db + 0f22f71 commit 3480faa

11 files changed

+42
-31
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
matrix:
1313
os: [ubuntu, macos]
1414
compiler: [g++, clang++]
15-
defines: [standard, PUGIXML_WCHAR_MODE, PUGIXML_COMPACT, PUGIXML_NO_EXCEPTIONS, PUGIXML_STRING_VIEW]
15+
defines: [standard, PUGIXML_WCHAR_MODE, PUGIXML_COMPACT, PUGIXML_NO_EXCEPTIONS]
1616
exclude:
1717
- os: macos
1818
compiler: g++
@@ -55,7 +55,7 @@ jobs:
5555
strategy:
5656
matrix:
5757
arch: [Win32, x64]
58-
defines: [standard, PUGIXML_WCHAR_MODE, PUGIXML_COMPACT, PUGIXML_NO_EXCEPTIONS, PUGIXML_STRING_VIEW]
58+
defines: [standard, PUGIXML_WCHAR_MODE, PUGIXML_COMPACT, PUGIXML_NO_EXCEPTIONS]
5959
steps:
6060
- uses: actions/checkout@v1
6161
- name: cmake configure

CMakeLists.txt

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ set(PUGIXML_BUILD_DEFINES CACHE STRING "Build defines for custom options")
3232
separate_arguments(PUGIXML_BUILD_DEFINES)
3333

3434
# Technically not needed for this file. This is builtin CMAKE global variable.
35-
option(BUILD_SHARED_LIBS "Build shared instead of static library" OFF)
35+
option(BUILD_SHARED_LIBS "Build shared instead of static library" OFF)
3636

3737
# Expose option to build PUGIXML as static as well when the global BUILD_SHARED_LIBS variable is set
3838
cmake_dependent_option(PUGIXML_BUILD_SHARED_AND_STATIC_LIBS
@@ -48,16 +48,14 @@ option(PUGIXML_INSTALL "Enable installation rules" ON)
4848
option(PUGIXML_NO_XPATH "Disable XPath" OFF)
4949
option(PUGIXML_NO_STL "Disable STL" OFF)
5050
option(PUGIXML_NO_EXCEPTIONS "Disable Exceptions" OFF)
51-
option(PUGIXML_STRING_VIEW "Enable std::string_view overloads" OFF) # requires C++17 and for PUGIXML_NO_STL to be OFF
52-
mark_as_advanced(PUGIXML_NO_XPATH PUGIXML_NO_STL PUGIXML_NO_EXCEPTIONS PUGIXML_STRING_VIEW)
51+
mark_as_advanced(PUGIXML_NO_XPATH PUGIXML_NO_STL PUGIXML_NO_EXCEPTIONS)
5352

5453
set(PUGIXML_PUBLIC_DEFINITIONS
5554
$<$<BOOL:${PUGIXML_WCHAR_MODE}>:PUGIXML_WCHAR_MODE>
5655
$<$<BOOL:${PUGIXML_COMPACT}>:PUGIXML_COMPACT>
5756
$<$<BOOL:${PUGIXML_NO_XPATH}>:PUGIXML_NO_XPATH>
5857
$<$<BOOL:${PUGIXML_NO_STL}>:PUGIXML_NO_STL>
5958
$<$<BOOL:${PUGIXML_NO_EXCEPTIONS}>:PUGIXML_NO_EXCEPTIONS>
60-
$<$<BOOL:${PUGIXML_STRING_VIEW}>:PUGIXML_STRING_VIEW>
6159
)
6260

6361
# This is used to backport a CMake 3.15 feature, but is also forwards compatible
@@ -66,15 +64,13 @@ if (NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
6664
MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<NOT:$<BOOL:${PUGIXML_STATIC_CRT}>>:DLL>)
6765
endif()
6866

69-
if (PUGIXML_STRING_VIEW AND (NOT DEFINED CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD LESS 17))
70-
message(WARNING "PUGIXML_STRING_VIEW requires CMAKE_CXX_STANDARD to be set to 17 or later")
71-
endif()
72-
73-
if (NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED)
74-
set(CMAKE_CXX_STANDARD_REQUIRED ON)
75-
endif()
67+
# Set the default C++ standard to C++17 if not set; CMake will automatically downgrade this if the compiler does not support it
68+
# When CMAKE_CXX_STANDARD_REQUIRED is set, we fall back to C++11 to avoid breaking older compilers
69+
if (NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED AND NOT DEFINED CMAKE_CXX_STANDARD AND NOT CMAKE_VERSION VERSION_LESS 3.8)
7670

77-
if (NOT DEFINED CMAKE_CXX_STANDARD)
71+
set(CMAKE_CXX_STANDARD 17)
72+
set(CMAKE_CXX_STANDARD_REQUIRED OFF)
73+
elseif (NOT DEFINED CMAKE_CXX_STANDARD)
7874
set(CMAKE_CXX_STANDARD 11)
7975
endif()
8076

docs/manual.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ NOTE: In that example `PUGIXML_API` is inconsistent between several source files
244244

245245
[[PUGIXML_HAS_LONG_LONG]]`PUGIXML_HAS_LONG_LONG` define enables support for `long long` type in pugixml. This define is automatically enabled if your platform is known to have `long long` support (i.e. has C{plus}{plus}11 support or uses a reasonably modern version of a known compiler); if pugixml does not recognize that your platform supports `long long` but in fact it does, you can enable the define manually.
246246

247-
[[PUGIXML_HAS_STRING_VIEW]]`PUGIXML_HAS_STRING_VIEW` define enables function overloads that accept `std::basic_string_view` arguments. This define is automatically enabled if built targeting C++17 or later AND if `PUGIXML_STRING_VIEW` is also defined. The requirement to additionally define `PUGIXML_STRING_VIEW` will be retired in a future version.
247+
[[PUGIXML_HAS_STRING_VIEW]]`PUGIXML_HAS_STRING_VIEW` define enables function overloads that accept `std::string_view` arguments. This define is automatically enabled if built targeting C{plus}{plus}17 or later; if pugixml does not recognize that your platform supports `std::string_view` but in fact it does, you can enable the define manually.
248248

249249
[[install.portability]]
250250
=== Portability

docs/manual.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<meta name="generator" content="Asciidoctor 2.0.23">
7+
<meta name="generator" content="Asciidoctor 2.0.20">
88
<meta name="author" content="website, repository">
99
<title>pugixml 1.14 manual</title>
1010
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
@@ -141,7 +141,7 @@
141141
#content::before{content:none}
142142
#header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0}
143143
#header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #dddddf}
144-
#header>h1:only-child{border-bottom:1px solid #dddddf;padding-bottom:8px}
144+
#header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px}
145145
#header .details{border-bottom:1px solid #dddddf;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:flex;flex-flow:row wrap}
146146
#header .details span:first-child{margin-left:-.125em}
147147
#header .details span.email a{color:rgba(0,0,0,.85)}
@@ -163,7 +163,6 @@
163163
#toctitle{color:#7a2518;font-size:1.2em}
164164
@media screen and (min-width:768px){#toctitle{font-size:1.375em}
165165
body.toc2{padding-left:15em;padding-right:0}
166-
body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px}
167166
#toc.toc2{margin-top:0!important;background:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #e7e7e9;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto}
168167
#toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em}
169168
#toc.toc2>ul{font-size:.9em;margin-bottom:0}
@@ -329,7 +328,7 @@
329328
a.image object{pointer-events:none}
330329
sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super}
331330
sup.footnote a,sup.footnoteref a{text-decoration:none}
332-
sup.footnote a:active,sup.footnoteref a:active,#footnotes .footnote a:first-of-type:active{text-decoration:underline}
331+
sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}
333332
#footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}
334333
#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em;border-width:1px 0 0}
335334
#footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;margin-bottom:.2em}
@@ -1028,7 +1027,7 @@ <h4 id="install.building.config"><a class="anchor" href="#install.building.confi
10281027
<p><a id="PUGIXML_HAS_LONG_LONG"></a><code>PUGIXML_HAS_LONG_LONG</code> define enables support for <code>long long</code> type in pugixml. This define is automatically enabled if your platform is known to have <code>long long</code> support (i.e. has C&#43;&#43;11 support or uses a reasonably modern version of a known compiler); if pugixml does not recognize that your platform supports <code>long long</code> but in fact it does, you can enable the define manually.</p>
10291028
</div>
10301029
<div class="paragraph">
1031-
<p><a id="PUGIXML_HAS_STRING_VIEW"></a><code>PUGIXML_HAS_STRING_VIEW</code> define enables function overloads that accept <code>std::basic_string_view</code> arguments. This define is automatically enabled if built targeting c++17 or later AND if <code>PUGIXML_STRING_VIEW</code> is also defined. The requirement to additionally define <code>PUGIXML_STRING_VIEW</code> will be retired in a future version.</p>
1030+
<p><a id="PUGIXML_HAS_STRING_VIEW"></a><code>PUGIXML_HAS_STRING_VIEW</code> define enables function overloads that accept <code>std::string_view</code> arguments. This define is automatically enabled if built targeting C&#43;&#43;17 or later; if pugixml does not recognize that your platform supports <code>std::string_view</code> but in fact it does, you can enable the define manually.</p>
10321031
</div>
10331032
</div>
10341033
</div>
@@ -1295,7 +1294,7 @@ <h3 id="dom.unicode"><a class="anchor" href="#dom.unicode"></a><a class="link" h
12951294
</div>
12961295
<div class="paragraph">
12971296
<p><a id="char_t"></a><a id="string_t"></a><a id="string_view_t"></a>
1298-
There is a special type, <code>pugi::char_t</code>, that is defined as the character type and depends on the library configuration; it will be also used in the documentation hereafter. There is also a type <code>pugi::string_t</code>, which is defined as the STL string of the character type; it corresponds to <code>std::string</code> in char mode and to <code>std::wstring</code> in wchar_t mode. Similarly, <code>string_view_t</code> is defined to be <code>std::basic_string_view&lt;char_t&gt;</code>. Overloads for <code>string_view_t</code> are only available when building for c++17 or later (see <code>PUGIXML_HAS_STRING_VIEW</code>).</p>
1297+
There is a special type, <code>pugi::char_t</code>, that is defined as the character type and depends on the library configuration; it will be also used in the documentation hereafter. There is also a type <code>pugi::string_t</code>, which is defined as the STL string of the character type; it corresponds to <code>std::string</code> in char mode and to <code>std::wstring</code> in wchar_t mode. Similarly, <code>string_view_t</code> is defined to be <code>std::basic_string_view&lt;char_t&gt;</code>. Overloads for <code>string_view_t</code> are only available when building for C++17 or later (see <code>PUGIXML_HAS_STRING_VIEW</code>).</p>
12991298
</div>
13001299
<div class="paragraph">
13011300
<p>In addition to the interface, the internal implementation changes to store XML data as <code>pugi::char_t</code>; this means that these two modes have different memory usage characteristics - generally UTF-8 mode is more memory and performance efficient, especially if <code>sizeof(wchar_t)</code> is 4. The conversion to <code>pugi::char_t</code> upon document loading and from <code>pugi::char_t</code> upon document saving happen automatically, which also carries minor performance penalty. The general advice however is to select the character mode based on usage scenario, i.e. if UTF-8 is inconvenient to process and most of your XML data is non-ASCII, wchar_t mode is probably a better choice.</p>
@@ -6217,7 +6216,7 @@ <h3 id="apiref.functions"><a class="anchor" href="#apiref.functions"></a><a clas
62176216
</div>
62186217
<div id="footer">
62196218
<div id="footer-text">
6220-
Last updated 2024-10-27 09:31:16 -0700
6219+
Last updated 2024-10-30 10:34:38 -0700
62216220
</div>
62226221
</div>
62236222
</body>

scripts/pugixml_vs2019.vcxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
100100
<DebugInformationFormat>OldStyle</DebugInformationFormat>
101101
<MinimalRebuild>false</MinimalRebuild>
102+
<LanguageStandard>stdcpp17</LanguageStandard>
102103
</ClCompile>
103104
<Link>
104105
<SubSystem>Windows</SubSystem>
@@ -115,6 +116,7 @@
115116
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
116117
<DebugInformationFormat>OldStyle</DebugInformationFormat>
117118
<MinimalRebuild>false</MinimalRebuild>
119+
<LanguageStandard>stdcpp17</LanguageStandard>
118120
</ClCompile>
119121
<Link>
120122
<SubSystem>Windows</SubSystem>
@@ -132,6 +134,7 @@
132134
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
133135
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
134136
<DebugInformationFormat>OldStyle</DebugInformationFormat>
137+
<LanguageStandard>stdcpp17</LanguageStandard>
135138
</ClCompile>
136139
<Link>
137140
<SubSystem>Windows</SubSystem>
@@ -151,6 +154,7 @@
151154
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
152155
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
153156
<DebugInformationFormat>OldStyle</DebugInformationFormat>
157+
<LanguageStandard>stdcpp17</LanguageStandard>
154158
</ClCompile>
155159
<Link>
156160
<SubSystem>Windows</SubSystem>

scripts/pugixml_vs2019_static.vcxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
<DebugInformationFormat>OldStyle</DebugInformationFormat>
101101
<MinimalRebuild>false</MinimalRebuild>
102102
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
103+
<LanguageStandard>stdcpp17</LanguageStandard>
103104
</ClCompile>
104105
<Link>
105106
<SubSystem>Windows</SubSystem>
@@ -117,6 +118,7 @@
117118
<DebugInformationFormat>OldStyle</DebugInformationFormat>
118119
<MinimalRebuild>false</MinimalRebuild>
119120
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
121+
<LanguageStandard>stdcpp17</LanguageStandard>
120122
</ClCompile>
121123
<Link>
122124
<SubSystem>Windows</SubSystem>
@@ -135,6 +137,7 @@
135137
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
136138
<DebugInformationFormat>OldStyle</DebugInformationFormat>
137139
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
140+
<LanguageStandard>stdcpp17</LanguageStandard>
138141
</ClCompile>
139142
<Link>
140143
<SubSystem>Windows</SubSystem>
@@ -155,6 +158,7 @@
155158
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
156159
<DebugInformationFormat>OldStyle</DebugInformationFormat>
157160
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
161+
<LanguageStandard>stdcpp17</LanguageStandard>
158162
</ClCompile>
159163
<Link>
160164
<SubSystem>Windows</SubSystem>

scripts/pugixml_vs2022.vcxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
100100
<DebugInformationFormat>OldStyle</DebugInformationFormat>
101101
<MinimalRebuild>false</MinimalRebuild>
102+
<LanguageStandard>stdcpp17</LanguageStandard>
102103
</ClCompile>
103104
<Link>
104105
<SubSystem>Windows</SubSystem>
@@ -115,6 +116,7 @@
115116
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
116117
<DebugInformationFormat>OldStyle</DebugInformationFormat>
117118
<MinimalRebuild>false</MinimalRebuild>
119+
<LanguageStandard>stdcpp17</LanguageStandard>
118120
</ClCompile>
119121
<Link>
120122
<SubSystem>Windows</SubSystem>
@@ -132,6 +134,7 @@
132134
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
133135
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
134136
<DebugInformationFormat>OldStyle</DebugInformationFormat>
137+
<LanguageStandard>stdcpp17</LanguageStandard>
135138
</ClCompile>
136139
<Link>
137140
<SubSystem>Windows</SubSystem>
@@ -151,6 +154,7 @@
151154
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
152155
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
153156
<DebugInformationFormat>OldStyle</DebugInformationFormat>
157+
<LanguageStandard>stdcpp17</LanguageStandard>
154158
</ClCompile>
155159
<Link>
156160
<SubSystem>Windows</SubSystem>

scripts/pugixml_vs2022_static.vcxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
<DebugInformationFormat>OldStyle</DebugInformationFormat>
101101
<MinimalRebuild>false</MinimalRebuild>
102102
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
103+
<LanguageStandard>stdcpp17</LanguageStandard>
103104
</ClCompile>
104105
<Link>
105106
<SubSystem>Windows</SubSystem>
@@ -117,6 +118,7 @@
117118
<DebugInformationFormat>OldStyle</DebugInformationFormat>
118119
<MinimalRebuild>false</MinimalRebuild>
119120
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
121+
<LanguageStandard>stdcpp17</LanguageStandard>
120122
</ClCompile>
121123
<Link>
122124
<SubSystem>Windows</SubSystem>
@@ -135,6 +137,7 @@
135137
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
136138
<DebugInformationFormat>OldStyle</DebugInformationFormat>
137139
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
140+
<LanguageStandard>stdcpp17</LanguageStandard>
138141
</ClCompile>
139142
<Link>
140143
<SubSystem>Windows</SubSystem>
@@ -155,6 +158,7 @@
155158
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
156159
<DebugInformationFormat>OldStyle</DebugInformationFormat>
157160
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
161+
<LanguageStandard>stdcpp17</LanguageStandard>
158162
</ClCompile>
159163
<Link>
160164
<SubSystem>Windows</SubSystem>

src/pugiconfig.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,11 @@
4646
// Uncomment this to switch to header-only version
4747
// #define PUGIXML_HEADER_ONLY
4848

49-
// Uncomment this to enable long long support
49+
// Uncomment this to enable long long support (usually enabled automatically)
5050
// #define PUGIXML_HAS_LONG_LONG
5151

52-
// Uncomment this to enable support for std::string_view (requires c++17 and for PUGIXML_NO_STL to not be set)
53-
// Note: In a future version of pugixml this macro will become obsolete.
54-
// Support will then be enabled automatically if the used C++ standard supports it.
55-
// #define PUGIXML_STRING_VIEW
52+
// Uncomment this to enable support for std::string_view (usually enabled automatically)
53+
// #define PUGIXML_HAS_STRING_VIEW
5654

5755
#endif
5856

src/pugixml.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
# include <string>
3939
#endif
4040

41-
// Check if std::string_view is both requested and available
42-
#if defined(PUGIXML_STRING_VIEW) && !defined(PUGIXML_NO_STL)
41+
// Check if std::string_view is available
42+
#if !defined(PUGIXML_HAS_STRING_VIEW) && !defined(PUGIXML_NO_STL)
4343
# if __cplusplus >= 201703L
4444
# define PUGIXML_HAS_STRING_VIEW
4545
# elif defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
@@ -231,7 +231,7 @@ namespace pugi
231231
// the document; this flag is only recommended for parsing documents with many PCDATA nodes in memory-constrained environments.
232232
// This flag is off by default.
233233
const unsigned int parse_embed_pcdata = 0x2000;
234-
234+
235235
// This flag determines whether determines whether the the two pcdata should be merged or not, if no intermediatory data are parsed in the document.
236236
// This flag is off by default.
237237
const unsigned int parse_merge_pcdata = 0x4000;

tests/autotest-appveyor.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ foreach ($vs in $args)
3737

3838
if (! $?) { throw "Error setting up VS$vs $arch" }
3939

40+
$cxx = if ($vs -ge 19) { "/std:c++17" } else { "" }
41+
4042
foreach ($defines in "standard", "PUGIXML_WCHAR_MODE", "PUGIXML_COMPACT")
4143
{
4244
$target = "tests_vs${vs}_${arch}_${defines}"
@@ -45,7 +47,7 @@ foreach ($vs in $args)
4547
Add-AppveyorTest $target -Outcome Running
4648

4749
Write-Output "# Building $target.exe"
48-
& cmd /c "cl.exe /MP /Fe$target.exe /EHsc /W4 /WX $deflist $sources 2>&1" | Tee-Object -Variable buildOutput
50+
& cmd /c "cl.exe /MP /Fe$target.exe /EHsc /W4 /WX $cxx $deflist $sources 2>&1" | Tee-Object -Variable buildOutput
4951

5052
if ($?)
5153
{

0 commit comments

Comments
 (0)