我已经制作了一个build.xml文件以在我的VS项目中使用,但是它需要使用/ std:c ++ 17进行编译,而且我不知道如何将其设置为构建配置xml。
<PropertyGroup>
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<SourceFolder>.\</SourceFolder>
</PropertyGroup>
<Target Name="Start">
<CallTarget Targets="Build"></CallTarget>
</Target>
<Target Name = "Build">
<MSBuild
Projects=".\FknUtils.sln"
Properties="Configuration=Release"
Targets="Clean;Build"
ContinueOnError="false"
StopOnFirstFailure="true"/>
</Target>
</Project>
您也可以通过右键单击解决方案资源管理器中的项目,选择Properties
,General
分隔符,然后在C++ Langyage Standard
字段中选择ISO C++17 Standard (std:c++17)
来执行此操作。
这会将选项<LanguageStandard>stdcpp17</LanguageStandard>
添加到您的配置文件中。
类似:
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<TreatWarningAsError>false</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>