Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dotnet/targets/Microsoft.Sdk.R2R.targets
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<!-- Set some default properties -->
<PropertyGroup Condition="'$(PublishReadyToRun)' == 'true' And '$(UseMonoRuntime)' == 'false' And '$(_UseNativeAot)' != 'true'">
<CreateR2RFramework Condition="'$(CreateR2RFramework)' == '' ">true</CreateR2RFramework>
<CreateR2RFramework Condition="'$(CreateR2RFramework)' == '' And ('$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS')">true</CreateR2RFramework>
<CreateR2RDylib Condition="'$(CreateR2RDylib)' == '' And '$(CreateR2RFramework)' != 'true'">true</CreateR2RDylib>

<FilterReadyToRunAssemblies Condition="'$(FilterReadyToRunAssemblies)' == '' And '$(Configuration)' != 'Release'">true</FilterReadyToRunAssemblies>
Expand Down
11 changes: 9 additions & 2 deletions msbuild/Xamarin.MacDev.Tasks/Tasks/ProcessRuntimeLibraries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

using Xamarin.Localization.MSBuild;
using Xamarin.Messaging.Build.Client;
using Xamarin.Utils;

namespace Xamarin.MacDev.Tasks;

Expand Down Expand Up @@ -120,9 +121,15 @@ public override bool Execute ()
if (group.All (v => v.GetMetadata ("Extension").Equals (".a", StringComparison.OrdinalIgnoreCase)))
continue;

// if we have a single .dylib, but we're linking statically, we need to convert it to a framework
// if we have a single .dylib, but we're linking statically, we need to convert it to a framework (if we're targeting a mobile platform)
// if we have both a .dylib and a .a, and we're linking statically, we still need to convert the .dylib to a .framework, because the .a is ignored/irrelevant
dylibsToFrameworks.AddRange (group.Where (v => v.GetMetadata ("Extension").Equals (".dylib", StringComparison.OrdinalIgnoreCase)));
var dylib = group.Where (v => v.GetMetadata ("Extension").Equals (".dylib", StringComparison.OrdinalIgnoreCase));
if (Platform == ApplePlatform.iOS || Platform == ApplePlatform.TVOS) {
dylibsToFrameworks.AddRange (dylib);
} else {
// on desktop just link with the dylib
output.AddRange (dylib);
}
continue;
case "dylib":
// we don't want any .a files, but we want all .dylib files.
Expand Down
Loading