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

Exclude HIDAPI support on iOS to avoid CoreBluetooth references #188

Closed
wants to merge 6 commits into from

Conversation

frenzibyte
Copy link
Member

@frenzibyte frenzibyte commented Dec 18, 2024

Intended to (fix) ppy/osu#31162 (comment). The constant is documented in https://wiki.libsdl.org/SDL3/CategoryHIDAPI, read last paragraph.

This can be confirmed to work by checking the SDL3 binary against otool. Here's a diff between last package and this PR:

diff --git a/./a b/./b
index 93cbf28..93c2131 100644
--- a/./a
+++ b/./b
@@ -1,4 +1,4 @@
-/Users/salman/.nuget/packages/ppy.sdl3-cs/2024.1128.0/runtimes/ios/native/SDL3.xcframework/ios-arm64/SDL3.framework/SDL3:
+SDL3:
        @rpath/SDL3.framework/SDL3 (compatibility version 108.0.0, current version 108.0.0)
        /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
        /System/Library/Frameworks/AudioToolbox.framework/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0)
@@ -14,7 +14,6 @@
        /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.120.2)
        /System/Library/Frameworks/AVFoundation.framework/AVFoundation (compatibility version 1.0.0, current version 2.0.0)
-       /System/Library/Frameworks/CoreBluetooth.framework/CoreBluetooth (compatibility version 1.0.0, current version 1.0.0)
        /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics (compatibility version 64.0.0, current version 1774.5.3)
        /System/Library/Frameworks/CoreMedia.framework/CoreMedia (compatibility version 1.0.0, current version 1.0.0)
        /System/Library/Frameworks/CoreMotion.framework/CoreMotion (compatibility version 1.0.0, current version 2890.16.16)

Copy link
Member

@Susko3 Susko3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every function in SDL_hidapi.g.cs should be marked with [UnsupportedOSPlatform("iOS")].

@frenzibyte
Copy link
Member Author

The attribute has been added manually to all members of the SDL_hidapi.g.cs file. Ideally this should've been done by ClangSharp but wildcard support was broken and not resolved until dotnet/ClangSharp#567 which is seemingly not included in the latest release of the tool.

@smoogipoo
Copy link
Contributor

Instead of manually adding to the .g.cs files, can you add the non-wildcard mappings in the .rsp instead?

@frenzibyte
Copy link
Member Author

Ah, better idea for now.

@frenzibyte
Copy link
Member Author

Closing as we've agreed in ppy/osu#31162 to just state that we don't use CoreBluetooth's API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants