[iOS] Add gss framework back into sample linker args (#83182)
authorSteve Pfister <steveisok@users.noreply.github.com>
Thu, 9 Mar 2023 16:28:47 +0000 (11:28 -0500)
committerGitHub <noreply@github.com>
Thu, 9 Mar 2023 16:28:47 +0000 (11:28 -0500)
https://github.com/dotnet/runtime/pull/81919 introduced a regression where the gss framework was omitted from the sample build. This change adds it back in.

Fixes https://github.com/dotnet/performance/issues/2924

src/mono/msbuild/apple/build/AppleApp.targets
src/tasks/AppleAppBuilder/Xcode.cs

index 6e97c7b..bf637dc 100644 (file)
@@ -36,7 +36,7 @@
 
     <!-- common linker arguments for app and library builds -->
     <ItemGroup>
-      <_CommonLinkerArgs Condition="'$(TargetOS)' != 'tvos'" Include="-framework GSS" />
+      <_CommonLinkerArgs Condition="'$(_IsLibraryMode)' == 'true' and '$(TargetOS)' != 'tvos' and '$(TargetOS)' != 'tvossimulator'" Include="-framework GSS" />
     </ItemGroup>
 
     <PropertyGroup>
index ed9fbf8..6116fad 100644 (file)
@@ -400,12 +400,20 @@ internal sealed class Xcode
             toLink += $"    {asmLinkFile}{Environment.NewLine}";
         }
 
+        string frameworks = "";
+        if ((Target == TargetNames.iOS) || (Target == TargetNames.iOSsim) || (Target == TargetNames.MacCatalyst))
+        {
+            frameworks = "\"-framework GSS\"";
+        }
+
         string appLinkerArgs = "";
         foreach(string linkerArg in extraLinkerArgs)
         {
             appLinkerArgs += $"    \"{linkerArg}\"{Environment.NewLine}";
         }
 
+        appLinkerArgs += $"    {frameworks}{Environment.NewLine}";
+
         cmakeLists = cmakeLists.Replace("%NativeLibrariesToLink%", toLink);
         cmakeLists = cmakeLists.Replace("%APP_LINKER_ARGS%", appLinkerArgs);
         cmakeLists = cmakeLists.Replace("%AotSources%", aotSources);