From 68aaef9ff71c32b30773ace860e02088ccc69735 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 2 Feb 2022 08:36:17 +0100 Subject: [PATCH] [dotnet] Ask the linker to not mark copied assemblies if we're in a 'don't link' scenario. (#14011) This speeds up builds significantly when the linker is disabled. Test case: building tests/dotnet/MySimpleApp for macOS. * Before: 37s * After: 9s * Difference: 26s (4x faster) Test case: run the .NET tests * Before: 2h55 * After: 1h43 * Difference: 1h12 (1.7x faster) Contributes towards https://github.com/xamarin/xamarin-macios/issues/10251. Ref: https://github.com/dotnet/linker/issues/2089 --- dotnet/targets/Xamarin.Shared.Sdk.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets index bf53cf109f28..6282da65f228 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.targets +++ b/dotnet/targets/Xamarin.Shared.Sdk.targets @@ -484,6 +484,7 @@ XamarinRuntime=$(_XamarinRuntime) <_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --custom-data "LinkerOptionsFile=$(_CustomLinkerOptionsFile)" + <_ExtraTrimmerArgs Condition="'$(TrimMode)' == 'copy' And '$(MarkCopiedAssemblies)' != 'true'">$(_ExtraTrimmerArgs) --custom-data DisableMarkingOfCopyAssemblies=true <_ExtraTrimmerArgs>$(_ExtraTrimmerArgs) --verbose