Files
osu-framework/osu.Framework.iOS/osu.Framework.iOS.Workarounds.targets

22 lines
1.5 KiB
XML

<Project>
<!-- Veldrid references libraries which cannot be AOT'd on iOS, replace them with stub assemblies.
See: https://github.com/mellinoe/veldrid/issues/472#issuecomment-1356461410 -->
<Target Name="OsuFrameworkIOSCopyStubAssemblies" BeforeTargets="_AOTCompile">
<ItemGroup>
<StubFiles Include="$(MSBuildThisFileDirectory)..\stubs\*" />
</ItemGroup>
<Copy Condition="'$(Platform)' == 'AnyCPU'" SourceFiles="@(StubFiles)" DestinationFolder="obj\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\linked\" />
<Copy Condition="'$(Platform)' != 'AnyCPU'" SourceFiles="@(StubFiles)" DestinationFolder="obj\$(Platform)\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\linked\" />
</Target>
<!-- OpenTabletDriver contains P/Invokes to the "Quartz" framework for native macOS code.
This leads iOS linker into attempting to include that framework, despite not existing on such platform.
See: https://github.com/OpenTabletDriver/OpenTabletDriver/issues/2524 / https://github.com/xamarin/xamarin-macios/issues/15118#issuecomment-1141893683 -->
<!-- There's also P/Invokes for "ApplicationServices" framework somewhere in the referenced libraries... -->
<Target Name="OsuFrameworkIOSRemoveMacOSFrameworks" BeforeTargets="_ComputeLinkNativeExecutableInputs" AfterTargets="_LoadLinkerOutput">
<ItemGroup>
<_LinkerFrameworks Remove="Quartz"/>
<_LinkerFrameworks Remove="ApplicationServices"/>
</ItemGroup>
</Target>
</Project>