diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets index fe1461e45d23b..963f1cbd6034e 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets @@ -2,9 +2,11 @@ - <_targetOS>$(NETCoreSdkPortableRuntimeIdentifier.SubString(0, $(NETCoreSdkPortableRuntimeIdentifier.IndexOf('-')))) - <_indexOfPeriod>$(_targetOS.IndexOf('.')) - <_targetOS Condition="'$(_indexOfPeriod)' > -1">$(_targetOS.SubString(0, $(_indexOfPeriod))) + <_useTPI Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'unix'">true + <_targetOS Condition="'$(_useTPI)' == 'true'">$(TargetPlatformIdentifier.ToLowerInvariant()) + <_targetOS Condition="'$(_useTPI)' != 'true'">$(NETCoreSdkPortableRuntimeIdentifier.SubString(0, $(NETCoreSdkPortableRuntimeIdentifier.IndexOf('-')))) + <_indexOfPeriod Condition="'$(_useTPI)' != 'true'">$(_targetOS.IndexOf('.')) + <_targetOS Condition="'$(_useTPI)' != 'true' and '$(_indexOfPeriod)' > -1">$(_targetOS.SubString(0, $(_indexOfPeriod))) <_targetOS Condition="$(_targetOS.StartsWith('win'))">win