From c01475b686cb83d73742e9737192dbe9e7c61553 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Wed, 8 Mar 2023 22:00:44 -0500 Subject: [PATCH 1/2] [iOS] Add gss framework back into sample linker args 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 6e97c7b016c84..b2084febf7459 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'" Include="-framework GSS" /> diff --git a/src/tasks/AppleAppBuilder/Xcode.cs b/src/tasks/AppleAppBuilder/Xcode.cs index ed9fbf8c97886..6116fad4bceb8 100644 --- a/src/tasks/AppleAppBuilder/Xcode.cs +++ b/src/tasks/AppleAppBuilder/Xcode.cs @@ -400,12 +400,20 @@ public string GenerateCMake( 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); From 2143fb28dd63ae780db1220b52c133f1a803a125 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Thu, 9 Mar 2023 09:17:41 -0500 Subject: [PATCH 2/2] Feedback --- src/mono/msbuild/apple/build/AppleApp.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/msbuild/apple/build/AppleApp.targets b/src/mono/msbuild/apple/build/AppleApp.targets index b2084febf7459..bf637dcc8b7ca 100644 --- a/src/mono/msbuild/apple/build/AppleApp.targets +++ b/src/mono/msbuild/apple/build/AppleApp.targets @@ -36,7 +36,7 @@ - <_CommonLinkerArgs Condition="'$(_IsLibraryMode)' == 'true' and '$(TargetOS)' != 'tvos'" Include="-framework GSS" /> + <_CommonLinkerArgs Condition="'$(_IsLibraryMode)' == 'true' and '$(TargetOS)' != 'tvos' and '$(TargetOS)' != 'tvossimulator'" Include="-framework GSS" />