传统上,我们已经能够设置 Microsoft.Cpp.Win32.User.props 文件,以帮助我们使用 PlatformToolset 为不同版本的 Visual Studio 进行不同的设置:
Visual Studio 2012 = v100
Visual Studio 2013 = v120
Visual Studio 2015 = v140
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build" ToolsVersion="4.0">
<PropertyGroup Condition="$(PlatformToolset) == 'v100'">
<IncludePath>C:\SDKs\boost_1_53_0;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="$(PlatformToolset) == 'v120'">
<IncludePath>C:\SDKs\boost_1_59_0;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="$(PlatformToolset) == 'v140'">
<IncludePath>C:\SDKs\boost_1_64_0;$(IncludePath)</IncludePath>
</PropertyGroup>
但我不知道如何为 Visual Studio 2017 执行此操作。什么版本的 PlatformToolset 是否正在使用,还是已完全放弃?
最佳答案
刚在我的 .vcxprof 文件中找到这个:
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
使用 PlatformToolset = v141 工作正常。
关于c++ - 如何为 VS2017 自定义 Microsoft.Cpp.Win32.User.props?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43950680/