[NativeAOT] Don't link Swift/CryptoKit on iOS-like platforms (#87216)
authorFilip Navara <navara@emclient.com>
Thu, 8 Jun 2023 02:10:07 +0000 (04:10 +0200)
committerGitHub <noreply@github.com>
Thu, 8 Jun 2023 02:10:07 +0000 (11:10 +0900)
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets

index 76d6dd23f338990c4f0bbcf6c70d75c662d83128..2412bd4b7947a462c93fb29a92e3d75a88187d14 100644 (file)
@@ -96,7 +96,7 @@ The .NET Foundation licenses this file to you under the MIT license.
 
     <ItemGroup Condition="'$(_IsApplePlatform)' == 'true'">
       <NativeFramework Include="CoreFoundation" />
-      <NativeFramework Include="CryptoKit" />
+      <NativeFramework Condition="'$(_targetOS)' == 'osx'" Include="CryptoKit" />
       <NativeFramework Include="Foundation" />
       <NativeFramework Include="Security" />
       <!-- The library builds don't reference the GSS API on tvOS builds. -->
@@ -119,12 +119,12 @@ The .NET Foundation licenses this file to you under the MIT license.
       <LinkerArg Include="-lstdc++" Condition="'$(LinkStandardCPlusPlusLibrary)' == 'true'" />
       <LinkerArg Include="-ldl" />
       <LinkerArg Include="-lobjc" Condition="'$(_IsApplePlatform)' == 'true'" />
-      <LinkerArg Include="-lswiftCore" Condition="'$(_IsApplePlatform)' == 'true'" />
-      <LinkerArg Include="-lswiftFoundation" Condition="'$(_IsApplePlatform)' == 'true'" />
+      <LinkerArg Include="-lswiftCore" Condition="'$(_targetOS)' == 'osx'" />
+      <LinkerArg Include="-lswiftFoundation" Condition="'$(_targetOS)' == 'osx'" />
       <LinkerArg Include="-lz" />
       <LinkerArg Include="-lrt" Condition="'$(_IsApplePlatform)' != 'true'" />
       <LinkerArg Include="-licucore" Condition="'$(_IsApplePlatform)' == 'true'" />
-      <LinkerArg Include="-L/usr/lib/swift" Condition="'$(_IsApplePlatform)' == 'true'" />
+      <LinkerArg Include="-L/usr/lib/swift" Condition="'$(_targetOS)' == 'osx'" />
       <LinkerArg Include="@(StaticICULibs)" Condition="'$(StaticICULinking)' == 'true'" />
       <LinkerArg Include="@(StaticSslLibs)" Condition="'$(StaticOpenSslLinking)' == 'true'" />
       <LinkerArg Include="-lm" />