Skip to content

Commit

Permalink
Merge pull request #875 from Sergio0694/dev/d2d-intrinsics-constant-r…
Browse files Browse the repository at this point in the history
…equired

Centralize and update PolySharp references
  • Loading branch information
Sergio0694 authored Nov 21, 2024
2 parents e1ffe5a + 763c856 commit 86a5073
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 38 deletions.
26 changes: 26 additions & 0 deletions build/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,30 @@
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)..\build\computesharp.snk</AssemblyOriginatorKeyFile>
<AssemblySignPublicKey>00240000048000009400000006020000002400005253413100040000010001001DA244ACFEE0D02ADF2D7F464B5E2562BB1AEF50B32DCD8B2DADEC659A5ED8B6C5817B03EB5E723067718A7972C936F626879DCE8E85636E7812B92CAB100D4947E3E6655AD49359E279A09F34B65E5ECA5FD5D8941C70BD48E56D8739A3BFF4F1C85071B7494D0B3A692F16CA6CC40585BCA8AD5B24BB2E7B834F15B6E667BB</AssemblySignPublicKey>
</PropertyGroup>

<!--
We need PolySharp for all .NET Standard 2.0 polyfills. We do not want to use polyfills in published projects,
as those should just adhere to the available APIs in each LTS release of .NET, so we only enable this reference
for projects which are not published (ie. tests and samples), or just for the source generator projects.
-->
<PropertyGroup>
<IsPolySharpPackageReferenceNeeded>false</IsPolySharpPackageReferenceNeeded>
<IsPolySharpPackageReferenceNeeded Condition="'$(IsPublishedProject)' == 'false' OR '$(IsSourceGeneratorProject)' == 'true'">true</IsPolySharpPackageReferenceNeeded>
</PropertyGroup>

<!-- Add the package reference, if needed -->
<ItemGroup Condition="'$(IsPolySharpPackageReferenceNeeded)' == 'true'">
<PackageReference Include="PolySharp" Version="1.15.0" PrivateAssets="all" IsImplicitlyDefined="true" />
</ItemGroup>

<!-- Define the type alias for [UnmanagedCallersOnly] when on the .NET Standard 2.0 target -->
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<Using Include="System.Runtime.InteropServices2.UnmanagedCallersOnlyAttribute" Alias="UnmanagedCallersOnlyAttribute" />
</ItemGroup>

<!-- Configure PolySharp options -->
<PropertyGroup>
<PolySharpIncludeRuntimeSupportedAttributes>true</PolySharpIncludeRuntimeSupportedAttributes>
<PolySharpUseInteropServices2NamespaceForUnmanagedCallersOnlyAttribute>true</PolySharpUseInteropServices2NamespaceForUnmanagedCallersOnlyAttribute>
</PropertyGroup>
</Project>
8 changes: 0 additions & 8 deletions samples/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,4 @@
<!-- Ignore platform compatibility warnings -->
<NoWarn>$(NoWarn);CA1416</NoWarn>
</PropertyGroup>

<!-- Reference PolySharp for all sample projects -->
<ItemGroup>
<PackageReference Include="PolySharp" Version="1.14.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>build;analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
22 changes: 0 additions & 22 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -83,26 +83,4 @@
<!-- Pack the license file, if present -->
<None Condition="$(IsLicenseFileAvailableForPacking)" Include="LICENSE.txt" Pack="true" PackagePath="\" Visible="False" />
</ItemGroup>

<!--
Reference PolySharp for all .NET Standard 2.0 polyfills.
Only needed for the .Core project and all source generators.
-->
<ItemGroup Condition="'$(MSBuildProjectName)' == 'ComputeSharp.Core' OR $(IsSourceGeneratorProject)">
<PackageReference Include="PolySharp" Version="1.14.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>build;analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<!-- Define the type alias for [UnmanagedCallersOnly] when on the .NET Standard 2.0 target -->
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<Using Include="System.Runtime.InteropServices2.UnmanagedCallersOnlyAttribute" Alias="UnmanagedCallersOnlyAttribute" />
</ItemGroup>

<!-- Configure PolySharp options -->
<PropertyGroup>
<PolySharpIncludeRuntimeSupportedAttributes>true</PolySharpIncludeRuntimeSupportedAttributes>
<PolySharpUseInteropServices2NamespaceForUnmanagedCallersOnlyAttribute>true</PolySharpUseInteropServices2NamespaceForUnmanagedCallersOnlyAttribute>
</PropertyGroup>
</Project>
8 changes: 0 additions & 8 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,4 @@
<!-- Missing readonly modifier for readonly struct members (not needed in tests) -->
<NoWarn>$(NoWarn);IDE0251</NoWarn>
</PropertyGroup>

<!-- Reference PolySharp for all test projects -->
<ItemGroup>
<PackageReference Include="PolySharp" Version="1.14.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>build;analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>

0 comments on commit 86a5073

Please sign in to comment.