<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <!-- Two flavors (PLAN.md §Phase 8): net48 = Windows 10/11 (x64, ViGEm +
         RioGamepad); net40 = Windows XP SP3 (x86 cabinets — .NET 4.0 is XP's
         ceiling). Modern language features come from PolySharp on both; net40
         async machinery comes from Microsoft.Bcl.Async (TaskEx via
         Compat/TaskCompat). Win32 P/Invoke (SendInput, DeviceIoControl) and
         in-box System.IO.Ports work on both. -->
    <TargetFrameworks>net48;net40</TargetFrameworks>
    <Platforms>x64</Platforms>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <LangVersion>latest</LangVersion>
  </PropertyGroup>

  <!-- net48 pins x64 (matches the driver + tray exe); net40 stays AnyCPU and
       the XP tray exe pins x86. -->
  <PropertyGroup Condition="'$(TargetFramework)' == 'net48'">
    <PlatformTarget>x64</PlatformTarget>
  </PropertyGroup>

  <ItemGroup Condition="'$(TargetFramework)' == 'net40'">
    <!-- net40 has no System.Net.Http assembly for the implicit global using. -->
    <Using Remove="System.Net.Http" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
    <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
    <PackageReference Include="PolySharp" Version="1.14.1">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFramework)' == 'net48'">
    <PackageReference Include="Nefarius.ViGEm.Client" Version="1.21.256" />
    <PackageReference Include="System.IO.Ports" Version="8.0.0" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFramework)' == 'net40'">
    <PackageReference Include="Microsoft.Bcl.Async" Version="1.0.168" />
    <PackageReference Include="System.ValueTuple" Version="4.5.0" />
  </ItemGroup>

</Project>
