Skip to content

Commit

Permalink
Merge pull request #812 from Sergio0694/dev/fix-generators-targets
Browse files Browse the repository at this point in the history
Update all analyzer .targets files for 4.9
  • Loading branch information
Sergio0694 authored Jun 9, 2024
2 parents a5cad31 + b4c841f commit ce70b9d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/ComputeSharp.Core/ComputeSharp.Core.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</ItemGroup>
</Target>

<!-- Remove the analyzer if using Roslyn < 4.5 (ComputeSharp.Core's generators require Roslyn 4.5) -->
<!-- Remove the analyzer if using Roslyn < 4.9 (ComputeSharp.Core's generators require Roslyn 4.9) -->
<Target Name="_ComputeSharpCoreRemoveAnalyzersForRoslyn3"
Condition="'$(CSharpCoreTargetsPath)' != ''"
AfterTargets="ResolvePackageDependenciesForBuild;ResolveNuGetPackageAssets"
Expand All @@ -29,10 +29,10 @@
<ComputeSharpCoreCurrentCompilerVersion>@(ComputeSharpCoreCurrentCompilerAssemblyIdentity->'%(Version)')</ComputeSharpCoreCurrentCompilerVersion>

<!-- The CurrentCompilerVersionIsNotNewEnough property can now be defined based on the Roslyn assembly version -->
<ComputeSharpCoreCurrentCompilerVersionIsNotNewEnough Condition="$([MSBuild]::VersionLessThan($(ComputeSharpCoreCurrentCompilerVersion), 4.5))">true</ComputeSharpCoreCurrentCompilerVersionIsNotNewEnough>
<ComputeSharpCoreCurrentCompilerVersionIsNotNewEnough Condition="$([MSBuild]::VersionLessThan($(ComputeSharpCoreCurrentCompilerVersion), 4.9))">true</ComputeSharpCoreCurrentCompilerVersionIsNotNewEnough>
</PropertyGroup>

<!-- If the Roslyn version is < 4.5, disable the source generators -->
<!-- If the Roslyn version is < 4.9, disable the source generators -->
<ItemGroup Condition ="'$(ComputeSharpCoreCurrentCompilerVersionIsNotNewEnough)' == 'true'">
<Analyzer Remove="@(_ComputeSharpCoreAnalyzer)"/>
</ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/ComputeSharp.D2D1/ComputeSharp.D2D1.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</ItemGroup>
</Target>

<!-- Remove the analyzer if using Roslyn < 4.8 (ComputeSharp.D2D1's generators require Roslyn 4.8) -->
<!-- Remove the analyzer if using Roslyn < 4.9 (ComputeSharp.D2D1's generators require Roslyn 4.9) -->
<Target Name="_ComputeSharpD2D1RemoveAnalyzersForRoslyn3"
Condition="'$(CSharpCoreTargetsPath)' != ''"
AfterTargets="ResolvePackageDependenciesForBuild;ResolveNuGetPackageAssets"
Expand All @@ -29,10 +29,10 @@
<ComputeSharpD2D1CurrentCompilerVersion>@(ComputeSharpD2D1CurrentCompilerAssemblyIdentity->'%(Version)')</ComputeSharpD2D1CurrentCompilerVersion>

<!-- The CurrentCompilerVersionIsNotNewEnough property can now be defined based on the Roslyn assembly version -->
<ComputeSharpD2D1CurrentCompilerVersionIsNotNewEnough Condition="$([MSBuild]::VersionLessThan($(ComputeSharpD2D1CurrentCompilerVersion), 4.8))">true</ComputeSharpD2D1CurrentCompilerVersionIsNotNewEnough>
<ComputeSharpD2D1CurrentCompilerVersionIsNotNewEnough Condition="$([MSBuild]::VersionLessThan($(ComputeSharpD2D1CurrentCompilerVersion), 4.9))">true</ComputeSharpD2D1CurrentCompilerVersionIsNotNewEnough>
</PropertyGroup>

<!-- If the Roslyn version is < 4.8, disable the source generators -->
<!-- If the Roslyn version is < 4.9, disable the source generators -->
<ItemGroup Condition ="'$(ComputeSharpD2D1CurrentCompilerVersionIsNotNewEnough)' == 'true'">
<Analyzer Remove="@(_ComputeSharpD2D1Analyzer)"/>
</ItemGroup>
Expand All @@ -42,7 +42,7 @@
emitting this manually lets us customize the message to inform developers as to why exactly the generators have been
disabled, and that ComputeSharp will not work at all unless a more up to date IDE or compiler version are used.
-->
<Error Condition ="'$(ComputeSharpD2D1CurrentCompilerVersionIsNotNewEnough)' == 'true'" Text="The ComputeSharp.D2D1 source generators have been disabled on the current configuration, as they need Roslyn 4.8 in order to work. ComputeSharp.D2D1 requires the source generators to run in order to process shaders, so the library cannot be used without a more up to date IDE (eg. VS 2022 17.8 or greater) or .NET SDK version (.NET 8 SDK or greater)."/>
<Error Condition ="'$(ComputeSharpD2D1CurrentCompilerVersionIsNotNewEnough)' == 'true'" Text="The ComputeSharp.D2D1 source generators have been disabled on the current configuration, as they need Roslyn 4.9 in order to work. ComputeSharp.D2D1 requires the source generators to run in order to process shaders, so the library cannot be used without a more up to date IDE (eg. VS 2022 17.8 or greater) or .NET SDK version (.NET 8 SDK or greater)."/>
</Target>

<!-- Remove the analyzer if Roslyn is missing -->
Expand Down
8 changes: 4 additions & 4 deletions src/ComputeSharp/ComputeSharp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</ItemGroup>
</Target>

<!-- Remove the analyzer if using Roslyn < 4.8 (ComputeSharp's generators require Roslyn 4.8) -->
<!-- Remove the analyzer if using Roslyn < 4.9 (ComputeSharp's generators require Roslyn 4.9) -->
<Target Name="_ComputeSharpRemoveAnalyzersForRoslyn3"
Condition="'$(CSharpCoreTargetsPath)' != ''"
AfterTargets="ResolvePackageDependenciesForBuild;ResolveNuGetPackageAssets"
Expand All @@ -29,10 +29,10 @@
<ComputeSharpCurrentCompilerVersion>@(ComputeSharpCurrentCompilerAssemblyIdentity->'%(Version)')</ComputeSharpCurrentCompilerVersion>

<!-- The CurrentCompilerVersionIsNotNewEnough property can now be defined based on the Roslyn assembly version -->
<ComputeSharpCurrentCompilerVersionIsNotNewEnough Condition="$([MSBuild]::VersionLessThan($(ComputeSharpCurrentCompilerVersion), 4.8))">true</ComputeSharpCurrentCompilerVersionIsNotNewEnough>
<ComputeSharpCurrentCompilerVersionIsNotNewEnough Condition="$([MSBuild]::VersionLessThan($(ComputeSharpCurrentCompilerVersion), 4.9))">true</ComputeSharpCurrentCompilerVersionIsNotNewEnough>
</PropertyGroup>

<!-- If the Roslyn version is < 4.8, disable the source generators -->
<!-- If the Roslyn version is < 4.9, disable the source generators -->
<ItemGroup Condition ="'$(ComputeSharpCurrentCompilerVersionIsNotNewEnough)' == 'true'">
<Analyzer Remove="@(_ComputeSharpAnalyzer)"/>
</ItemGroup>
Expand All @@ -42,7 +42,7 @@
emitting this manually lets us customize the message to inform developers as to why exactly the generators have been
disabled, and that ComputeSharp will not work at all unless a more up to date IDE or compiler version are used.
-->
<Error Condition ="'$(ComputeSharpCurrentCompilerVersionIsNotNewEnough)' == 'true'" Text="The ComputeSharp source generators have been disabled on the current configuration, as they need Roslyn 4.8 in order to work. ComputeSharp requires the source generators to run in order to process shaders, so the library cannot be used without a more up to date IDE (eg. VS 2022 17.8 or greater) or .NET SDK version (.NET 8 SDK or greater)."/>
<Error Condition ="'$(ComputeSharpCurrentCompilerVersionIsNotNewEnough)' == 'true'" Text="The ComputeSharp source generators have been disabled on the current configuration, as they need Roslyn 4.9 in order to work. ComputeSharp requires the source generators to run in order to process shaders, so the library cannot be used without a more up to date IDE (eg. VS 2022 17.8 or greater) or .NET SDK version (.NET 8 SDK or greater)."/>
</Target>

<!-- Remove the analyzer if Roslyn is missing -->
Expand Down

0 comments on commit ce70b9d

Please sign in to comment.