<!--
***********************************************************************************************
Sdk.props

WARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
          created a backup copy.  Incorrect changes to this file will make it
          impossible to load or build your projects from the command-line or the IDE.

Copyright (c) .NET Foundation. All rights reserved. 
***********************************************************************************************
-->
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  
  <Import Project="$(MSBuildThisFileDirectory)\..\..\PVSBuildToolsNETCoreCommon.props" Condition="'$(PVSBuildTools_NETCoreCommonProps)' == ''" />

  <PropertyGroup>
    <_MicrosoftWindowsDesktopSdkImported>true</_MicrosoftWindowsDesktopSdkImported>
  </PropertyGroup>

  <!--
    Workaround: https://github.com/microsoft/msbuild/issues/4948
    Disable .NET Framework's inbox WinFX targets when using the SDK, since, we really don't use it's build logic
    and is superseded by 'WindowsDesktop' SDK that provides it's own WinFX for both NETFX and CoreCLR targets.
    Make it opt-out, just in case, if something fails or we don't want to use 'WindowsDesktop' SDK's version.
  -->
  <PropertyGroup>
    <ImportFrameworkWinFXTargets Condition="'$(ImportFrameworkWinFXTargets)' == ''">false</ImportFrameworkWinFXTargets>
  </PropertyGroup>

  <Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />  

  <PropertyGroup Condition="'$(MicrosoftWindowsDesktopSdkPath)' == ''">
    <MicrosoftWindowsDesktopSdkPath>$([System.IO.Path]::GetFullPath($(PVSBuildTools_NetCoreWinDesktopTargets)))</MicrosoftWindowsDesktopSdkPath>
  </PropertyGroup>

  <!-- 
	  PVS-Studio: Starting from .NET5, WindowsDesktop imports automatically into Microsoft.NET.Sdk if needed. 
      If there is no .NET 5 SDK in the system, import below is required for correct work with projects that use WindowsDesktop.
  -->
  <Import Project="$(MicrosoftWindowsDesktopSdkPath)\Microsoft.NET.Sdk.WindowsDesktop.props" 
          Condition="'$(PVSBuildTools_NETCoreSdkMajorVersion)' != '' and '$(PVSBuildTools_NETCoreSdkMajorVersion)' &lt; '5'" />

  <PropertyGroup Condition="'$(PVSBuildTools_NETCoreSdkMajorVersion)' != '' and '$(PVSBuildTools_NETCoreSdkMajorVersion)' &gt;= '5'">
    <ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
  </PropertyGroup>

</Project>
