-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDirectory.Build.target
12 lines (11 loc) · 1.09 KB
/
Directory.Build.target
1
2
3
4
5
6
7
8
9
10
11
12
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="_DevToysLongPathEnabled" BeforeTargets="CoreCompile" Condition="'$([MSBuild]::IsOsPlatform(Windows))' and '$(MSBuildThisFileDirectory.Length)' > 25">
<!---
Validation for LongPath support (source https://github.com/dotnet/roslyn/blob/c8eecdb9563127988b3cb564a493eae9ef254a88/eng/build.ps1#L607)
https://docs.microsoft.com/en-us/archive/blogs/jeremykuhne/net-4-6-2-and-long-paths-on-windows-10#enabling-win32-long-path-support
-->
<Warning Condition="'$(registry:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem@LongPathsEnabled)'!='1'" Text="LongPath is not enabled, you may experience build errors. You can avoid these by enabling LongPath. You can enable it by running `tools/enable-long-paths.reg`. More information on https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell#enable-long-paths-in-windows-10-version-1607-and-later"/>
</Target>
</Project>