-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDirectory.Build.props
36 lines (28 loc) · 1.71 KB
/
Directory.Build.props
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?xml version="1.0" encoding="utf-8"?>
<!--
为Cpp工程强制开启 PackageReferences 支持
Visual Studio 2017使用以后只能让MSBuild以及nuget.exe支持包还原。
Visual Studio 2019 16.8或者更高版本可以直接让Visual Studio NuGet插件支持包管理。
使用方法:将此文件复制到 sln 或者 vcxproj同级目录。
作者:mingkuang
最后修订:2021-06-21
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Condition="'$(MSBuildProjectExtension)' == '.vcxproj'">
<!--强制引入PackageReferences-->
<ProjectCapability Include="PackageReferences" />
</ItemGroup>
<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.vcxproj'">
<!--指定自己的体系为native-->
<NuGetTargetMoniker Condition="'$(NuGetTargetMoniker)' == ''">native,Version=v0.0</NuGetTargetMoniker>
<!--如果不指定这一行,那么arm64平台会找不到RID而失败-->
<RuntimeIdentifiers Condition="'$(RuntimeIdentifiers)' == ''">win;win-x86;win-x64;win-arm;win-arm64</RuntimeIdentifiers>
<!--默认指定为最新 Windows 10 SDK-->
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == ''">$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))</WindowsTargetPlatformVersion>
</PropertyGroup>
<!--从兼容性考虑,继续向上搜索 Directory.Build.props-->
<PropertyGroup>
<DirectoryBuildPropsPath>$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))</DirectoryBuildPropsPath>
</PropertyGroup>
<Import Project="$(DirectoryBuildPropsPath)" Condition="'$(DirectoryBuildPropsPath)' != ''"/>
</Project>