We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5368 - iOS static library needs to have hidapi file added to compile sources
Summary: iOS static library needs to have hidapi file added to compile sources
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: iPhone/iPod touch iOS (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-27 23:57 UTC by Dominik Reichardt
Modified: 2020-12-02 00:23 UTC (History)
0 users

See Also:


Attachments
patch that adds hidapi main file to compile sources for all static targets (2.52 KB, patch)
2020-11-28 19:46 UTC, Dominik Reichardt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Reichardt 2020-11-27 23:57:41 UTC
Trying to integrate the latest SDL2 changes into our iOS project of Exult I've stumbled over the fact that the static SDL2 library for iOS needs /src/hidapi/ios/hid.m added to the compile sources.

In Xcode open the project file -> click on the target  "static library-ios" ->  click on "build phases" -> add /src/hidapi/ios/hid.m to "Compile sources".

I had no luck adding and embedding the hidapi framework for iOS. This works for the simulator and even for attached devices but when you try to archive such a project for upload to the App Store your archive is not valid for that.
So making the static library completely static is the only way.
Comment 1 Dominik Reichardt 2020-11-28 19:46:11 UTC
Created attachment 4545 [details]
patch that adds hidapi main file to compile sources for all static targets

This patch adds the necessary hidapi files to all three static targets.
Comment 2 Sam Lantinga 2020-12-01 22:40:37 UTC
The solution for most people is to disable SDL_JOYSTICK_HIDAPI support on iOS builds, as they probably don't need Steam Controller support and this removes a Bluetooth dependency.

I'll ponder the best way to handle this, and in the meantime we should document that if you're building with the static library then you should disable that.
Comment 3 Sam Lantinga 2020-12-01 22:44:05 UTC
Okay, this is disabled by default on iOS and tvOS:
https://hg.libsdl.org/SDL/rev/4257e4cd0c60
Comment 4 Dominik Reichardt 2020-12-01 22:57:09 UTC
Thanks, I'll need to test but it looks as that suits my simple needs ;)

But eventually you probably need to figure out how to andle this static build IF you want hidapi to be enabled.
Comment 5 Sam Lantinga 2020-12-02 00:23:48 UTC
Oh, that's easy, just make the same change that your patch does. I just don't want to force everybody to do that by default.