From c5dd6cbdede4d0ac81b844e3a84be3b8c32ba46b Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Thu, 28 Nov 2024 00:52:46 +0200 Subject: [PATCH] Move the Blazor workaround into WASM (#3082) The workaround needed for WASM is not really Blazor specific and if the project is not using the Blazor views, the fix will not be applied to the build. (cherry picked from commit 32fbf8deb26b9f1d949d5a995a360260b1e98241) --- .../buildTransitive/HarfBuzzSharp.targets | 18 ++++++++++++++++++ binding/IncludeNativeAssets.SkiaSharp.targets | 19 ++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/binding/HarfBuzzSharp.NativeAssets.WebAssembly/buildTransitive/HarfBuzzSharp.targets b/binding/HarfBuzzSharp.NativeAssets.WebAssembly/buildTransitive/HarfBuzzSharp.targets index 7198786ae6..6e2fdd3bb6 100644 --- a/binding/HarfBuzzSharp.NativeAssets.WebAssembly/buildTransitive/HarfBuzzSharp.targets +++ b/binding/HarfBuzzSharp.NativeAssets.WebAssembly/buildTransitive/HarfBuzzSharp.targets @@ -31,4 +31,22 @@ + + + + <_WasmLinkStepArgs Remove="@(_EmccLinkStepArgs)" /> + <_EmccLinkStepArgs Remove=""%(_WasmNativeFileForLinking.Identity)"" /> + <_WasmLinkDependencies Remove="@(_WasmNativeFileForLinking)" /> + + <_SkiaSharpToReorder Include="@(_WasmNativeFileForLinking)" Condition="$([System.String]::Copy('%(FullPath)').Contains('libSkiaSharp.a'))" /> + <_WasmNativeFileForLinking Remove="@(_SkiaSharpToReorder)" /> + <_WasmNativeFileForLinking Include="@(_SkiaSharpToReorder)" /> + + <_EmccLinkStepArgs Include=""%(_WasmNativeFileForLinking.Identity)"" /> + <_WasmLinkDependencies Include="@(_WasmNativeFileForLinking)" /> + <_WasmLinkStepArgs Include="@(_EmccLinkStepArgs)" /> + + + \ No newline at end of file diff --git a/binding/IncludeNativeAssets.SkiaSharp.targets b/binding/IncludeNativeAssets.SkiaSharp.targets index 4596f8942d..ac82a653ea 100644 --- a/binding/IncludeNativeAssets.SkiaSharp.targets +++ b/binding/IncludeNativeAssets.SkiaSharp.targets @@ -79,7 +79,24 @@ - + + + + <_WasmLinkStepArgs Remove="@(_EmccLinkStepArgs)" /> + <_EmccLinkStepArgs Remove=""%(_WasmNativeFileForLinking.Identity)"" /> + <_WasmLinkDependencies Remove="@(_WasmNativeFileForLinking)" /> + + <_SkiaSharpToReorder Include="@(_WasmNativeFileForLinking)" Condition="$([System.String]::Copy('%(FullPath)').Contains('libSkiaSharp.a'))" /> + <_WasmNativeFileForLinking Remove="@(_SkiaSharpToReorder)" /> + <_WasmNativeFileForLinking Include="@(_SkiaSharpToReorder)" /> + + <_EmccLinkStepArgs Include=""%(_WasmNativeFileForLinking.Identity)"" /> + <_WasmLinkDependencies Include="@(_WasmNativeFileForLinking)" /> + <_WasmLinkStepArgs Include="@(_EmccLinkStepArgs)" /> + + + \ No newline at end of file