Skip to content

Commit e15f0c2

Browse files
committed
[dotnet] Don't suppress trimmer warnings anymore when 'TrimMode=full' is set.
1 parent d20ff65 commit e15f0c2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

dotnet/targets/Xamarin.Shared.Sdk.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
-->
4848
<_OriginalSuppressTrimAnalysisWarnings>$(SuppressTrimAnalysisWarnings)</_OriginalSuppressTrimAnalysisWarnings>
4949
<SuppressTrimAnalysisWarnings Condition="'$(_UseNativeAot)' == 'true'">true</SuppressTrimAnalysisWarnings>
50-
<SuppressTrimAnalysisWarnings Condition="'$(SuppressTrimAnalysisWarnings)' == ''">true</SuppressTrimAnalysisWarnings>
5150

5251
<AfterMicrosoftNETSdkTargets>$(AfterMicrosoftNETSdkTargets);$(MSBuildThisFileDirectory)Microsoft.$(_PlatformName).Sdk.targets</AfterMicrosoftNETSdkTargets>
5352

dotnet/targets/Xamarin.Shared.Sdk.targets

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,10 @@
526526
<!-- Yep, we want to run ILLink as well, because we need our custom steps to run (NativeAOT sets this to false, so set it back to true) -->
527527
<RunILLink Condition="'$(PublishAot)' == 'true'">true</RunILLink>
528528

529+
<!-- Suppress trimmer warnings unless we're trimming all assemblies -->
530+
<SuppressTrimAnalysisWarnings Condition="'$(SuppressTrimAnalysisWarnings)' == '' And '$(TrimMode)' == 'full'">false</SuppressTrimAnalysisWarnings>
531+
<SuppressTrimAnalysisWarnings Condition="'$(SuppressTrimAnalysisWarnings)' == '''">false</SuppressTrimAnalysisWarnings>
532+
529533
<!-- Pass the custom options to our custom steps -->
530534
<_CustomLinkerOptionsFile>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)custom-linker-options.txt'))</_CustomLinkerOptionsFile>
531535
<_CustomLinkerOptionsFile Condition="'$(BuildSessionId)' != ''">$(IntermediateOutputPath)custom-linker-options.txt</_CustomLinkerOptionsFile>

0 commit comments

Comments
 (0)