From a92ed6e2ce778c8b18dfa66f8f75368eca901f99 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Thu, 9 Mar 2023 11:28:47 -0500 Subject: [PATCH] [iOS] Add gss framework back into sample linker args (#83182) 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 | 2 +- src/tasks/AppleAppBuilder/Xcode.cs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mono/msbuild/apple/build/AppleApp.targets b/src/mono/msbuild/apple/build/AppleApp.targets index 6e97c7b016c..bf637dcc8b7 100644 --- a/src/mono/msbuild/apple/build/AppleApp.targets +++ b/src/mono/msbuild/apple/build/AppleApp.targets @@ -36,7 +36,7 @@ - <_CommonLinkerArgs Condition="'$(TargetOS)' != 'tvos'" Include="-framework GSS" /> + <_CommonLinkerArgs Condition="'$(_IsLibraryMode)' == 'true' and '$(TargetOS)' != 'tvos' and '$(TargetOS)' != 'tvossimulator'" Include="-framework GSS" /> diff --git a/src/tasks/AppleAppBuilder/Xcode.cs b/src/tasks/AppleAppBuilder/Xcode.cs index ed9fbf8c978..6116fad4bce 100644 --- a/src/tasks/AppleAppBuilder/Xcode.cs +++ b/src/tasks/AppleAppBuilder/Xcode.cs @@ -400,12 +400,20 @@ public void CreateXcodeProject(string projectName, string cmakeDirectoryPath) 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); -- GitLab