Skip to content

Commit 65e90b2

Browse files
committed
Merged PR 33539: Update .NET 6 MSBuild configuration
Same as !33538 but for WindowsAppSDK. ---- #### AI description (iteration 1) #### PR Classification Code cleanup and configuration update. #### PR Summary This pull request updates the MSBuild configuration for .NET 6, improving platform handling and warning messages. - Updated platform property names and added support for `arm64` in `/build/nuget/Microsoft.Graphics.Win2D-WinUI3.targets`. - Enhanced warning message for unsupported 'AnyCPU' builds in `/build/nuget/Microsoft.Graphics.Win2D-WinUI3.targets`. - Adjusted file paths in `/build/nuget/Microsoft.Graphics.Win2D.nuspec` to ensure correct inclusion of target files.
1 parent 57d3dfd commit 65e90b2

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Win2D Changelog
22

3+
## Win2D-WinUI 1.3.2
4+
_January 22nd, 2025_
5+
- Enable transitive MSBuild configuration
6+
- Fix an issue causing CanvasAnimatedControl to use 100% of the CPU in some scenarios
7+
38
## Win2D-WinUI 1.3.1
49
_December 12th, 2024_
510
- Fix pause/resume issues with CanvasAnimatedControl
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33

4+
<!-- Set the platform from the RID, first -->
45
<PropertyGroup>
56
<win2d-Platform Condition="$(RuntimeIdentifier.EndsWith('-x64'))">x64</win2d-Platform>
67
<win2d-Platform Condition="$(RuntimeIdentifier.EndsWith('-x86'))">x86</win2d-Platform>
8+
<win2d-Platform Condition="$(RuntimeIdentifier.EndsWith('-arm64'))">arm64</win2d-Platform>
79
</PropertyGroup>
810

11+
<!-- If still empty, try to set the platform based on the build platform -->
912
<PropertyGroup Condition="'$(win2d-Platform)' == ''">
1013
<win2d-Platform Condition="'$(Platform)' == 'Win32'">x86</win2d-Platform>
1114
<win2d-Platform Condition="'$(Platform)' != 'Win32'">$(Platform)</win2d-Platform>
@@ -16,21 +19,19 @@
1619
<Win2DWarnNoPlatform Condition="'$(Win2DWarnNoPlatform)' == ''">true</Win2DWarnNoPlatform>
1720
</PropertyGroup>
1821

19-
<ItemGroup>
20-
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\..\runtimes\win-$(win2d-Platform)\native\Microsoft.Graphics.Canvas.dll" Condition="'$(win2d-Platform)' != ''" />
21-
</ItemGroup>
22-
23-
<Target Name="Win2DWarnNoPlatform" BeforeTargets="BeforeBuild" Condition="'$(win2d-Platform)' == '' and '$(Win2DWarnNoPlatform)' == 'true'">
24-
<Warning Text="Microsoft.Graphics.Canvas.dll could not be copied because the AnyCPU platform is being used. Please specify a specific platform to copy this file." />
25-
</Target>
26-
22+
<!-- Register the Win2D .winmd in the APPX manifest (requires the new MSIX tooling) -->
2723
<ItemGroup>
2824
<WindowsMetadataReference Include="$(Win2DWinMDPath)" Implementation="$(Win2DWinMDImplementationDllName)" />
2925
</ItemGroup>
3026

3127
<!--
32-
Don't import Win2D.common.targets here, as it will cause build failures because desktop project
33-
files don't define $(TargetPlatformVersion) with the same semantics as with UWP or C++ project files.
28+
Emit a warning if building as 'AnyCPU', which is not supported. Note that we are emitting this warning but
29+
we are not copying the .dll ourselves. NuGet will do that automatically when projects are published.
3430
-->
31+
<Target Name="Win2DWarnNoPlatform" BeforeTargets="BeforeBuild" Condition="'$(win2d-Platform)' == '' and '$(Win2DWarnNoPlatform)' == 'true'">
32+
<Warning
33+
Code="WIN2D0001"
34+
Text="'Microsoft.Graphics.Canvas.dll' cannot be referenced correctly, because the project is being built as 'AnyCPU'. Please specify a specific platform (eg. 'x64'), publish with a RID (runtime identifier, eg. 'win-x64'), or set 'Win2DWarnNoPlatform' to suppress this error (note: you'll need to manually handle referencing the Win2D .dll in that case)." />
35+
</Target>
3536

36-
</Project>
37+
</Project>

build/nuget/Microsoft.Graphics.Win2D.nuspec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,18 @@
2121
<files>
2222

2323
<file target="Win2d.githash.txt" src="obj\Win2d.githash.txt" />
24-
2524
<file target="icon.png" src="build\nuget\icon.png" />
25+
2626
<file target="build\native\Microsoft.Graphics.Win2D.targets" src="build\nuget\Microsoft.Graphics.Win2D-native.targets" />
2727
<file target="build\net6.0-windows10.0.19041.0\Microsoft.Graphics.Win2D.props" src="build\nuget\Microsoft.Graphics.Win2D-WinUI3.props" />
2828
<file target="build\net6.0-windows10.0.19041.0\Microsoft.Graphics.Win2D.targets" src="build\nuget\Microsoft.Graphics.Win2D-WinUI3.targets" />
2929
<file target="build\net45\Microsoft.Graphics.Win2D.targets" src="build\nuget\Microsoft.Graphics.Win2D-managed.targets" />
3030
<file target="build\win10\Microsoft.Graphics.Win2D.targets" src="build\nuget\Microsoft.Graphics.Win2D-win10.targets" />
3131
<file target="build\Win2D.common.targets" src="build\nuget\Win2D.common.targets" />
3232

33+
<file target="buildTransitive\net6.0-windows10.0.19041.0\Microsoft.Graphics.Win2D.props" src="build\nuget\Microsoft.Graphics.Win2D-WinUI3.props" />
34+
<file target="buildTransitive\net6.0-windows10.0.19041.0\Microsoft.Graphics.Win2D.targets" src="build\nuget\Microsoft.Graphics.Win2D-WinUI3.targets" />
35+
3336
<file target="include\x86\Microsoft.Graphics.Canvas.h" src="obj\winrt.lib.uap\UAPx86\release\Generated Files\Microsoft.Graphics.Canvas.h"/>
3437
<file target="include\x64\Microsoft.Graphics.Canvas.h" src="obj\winrt.lib.uap\UAPx64\release\Generated Files\Microsoft.Graphics.Canvas.h"/>
3538
<file target="include\arm64\Microsoft.Graphics.Canvas.h" src="obj\winrt.lib.uap\UAParm64\release\Generated Files\Microsoft.Graphics.Canvas.h"/>

build/nuget/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.1
1+
1.3.2

0 commit comments

Comments
 (0)