From bf36e1464ed23b58991ba14a68120612eea4c6ce Mon Sep 17 00:00:00 2001 From: Adeel <3840695+am11@users.noreply.github.com> Date: Sat, 25 Feb 2023 01:22:18 +0200 Subject: [PATCH] Respect TPI in targetOS calculation --- .../Microsoft.DotNet.ILCompiler.SingleEntry.targets | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets index fe1461e45d23be..963f1cbd6034eb 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