Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around DirectX libraries blocking iOS from building #5592

Merged
merged 4 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,4 @@
<ProjectReference Include="..\..\..\..\osu.Framework\osu.Framework.csproj" />
<ProjectReference Include="..\..\..\..\osu.Framework.iOS\osu.Framework.iOS.csproj" />
</ItemGroup>
<!-- 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 -->
<Target Name="OsuFrameworkIOSRemoveQuartz" BeforeTargets="_ComputeLinkNativeExecutableInputs" AfterTargets="_LoadLinkerOutput">
<ItemGroup>
<_LinkerFrameworks Remove="Quartz" />
</ItemGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,4 @@
<ProjectReference Include="..\..\..\..\osu.Framework\osu.Framework.csproj" />
<ProjectReference Include="..\..\..\..\osu.Framework.iOS\osu.Framework.iOS.csproj" />
</ItemGroup>
<!-- 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 -->
<Target Name="OsuFrameworkIOSRemoveQuartz" BeforeTargets="_ComputeLinkNativeExecutableInputs" AfterTargets="_LoadLinkerOutput">
<ItemGroup>
<_LinkerFrameworks Remove="Quartz" />
</ItemGroup>
</Target>
</Project>
8 changes: 8 additions & 0 deletions osu.Framework.iOS.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
<NativeReference Include="$(MSBuildThisFileDirectory)osu.Framework.iOS\runtimes\ios\native\libswresample.xcframework" Kind="Framework" SmartLink="false" ForceLoad="true" />
<NativeReference Include="$(MSBuildThisFileDirectory)osu.Framework.iOS\runtimes\ios\native\libswscale.xcframework" Kind="Framework" SmartLink="false" ForceLoad="true" />
</ItemGroup>
<!-- 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)osu.Framework.iOS\stubs\*" />
</ItemGroup>
<Copy 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 -->
Expand Down
18 changes: 18 additions & 0 deletions osu.Framework.iOS/osu.Framework.iOS.Workarounds.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<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 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 -->
<Target Name="OsuFrameworkIOSRemoveQuartz" BeforeTargets="_ComputeLinkNativeExecutableInputs" AfterTargets="_LoadLinkerOutput">
<ItemGroup>
<_LinkerFrameworks Remove="Quartz" />
</ItemGroup>
</Target>
</Project>
7 changes: 3 additions & 4 deletions osu.Framework.iOS/osu.Framework.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
<PackageReference Include="ppy.osuTK.iOS" Version="1.0.211" />
</ItemGroup>
<ItemGroup>
<None Include="runtimes\**\*">
<Pack>true</Pack>
<PackagePath>runtimes</PackagePath>
</None>
<None Include="runtimes\**\*" Pack="true" PackagePath="runtimes" />
<None Include="stubs\**\*" Pack="true" PackagePath="stubs" />
<Content Include="osu.Framework.iOS.Workarounds.targets" Pack="true" PackagePath="build\$(PackageId).targets" />
</ItemGroup>
</Project>
Binary file not shown.
Binary file added osu.Framework.iOS/stubs/SharpGen.Runtime.dll
Binary file not shown.
Binary file added osu.Framework.iOS/stubs/Vortice.DXGI.dll
Binary file not shown.
Binary file not shown.
Binary file added osu.Framework.iOS/stubs/Vortice.DirectX.dll
Binary file not shown.