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 5417 - SDL_Init fails on iOS due to removed code from SDL_uikitappdelegate.m
Summary: SDL_Init fails on iOS due to removed code from SDL_uikitappdelegate.m
Status: ASSIGNED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.15
Hardware: ARM macOS 10.15
: P2 blocker
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.16
Depends on:
Blocks:
 
Reported: 2020-12-26 08:58 UTC by Steve Robinson
Modified: 2020-12-28 19:59 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Robinson 2020-12-26 08:58:58 UTC
When building SDL2-static from 2.0.14 source and using it with the 'Rectangles' example, SDL_Init failed due to SDL_MainIsReady being false. The identical set up with 2.0.12 worked fine.

Adding the following lines from src\video\uikit\SDL_uikitappdelegate.m in 2.0.12 fixed the problem:
#if defined(SDL_MAIN_NEEDED) && !defined(IOS_DYLIB)
/* SDL is being built as a static library, include main() */
int main(int argc, char *argv[])
{
	return SDL_UIKitRunApp(argc, argv, SDL_main);
}
#endif /* SDL_MAIN_NEEDED && !IOS_DYLIB */

Environment:
CMake: 3.19.2
Xcode: 12.3
macOS: 11.1
Comment 1 Ozkan Sezer 2020-12-26 12:52:29 UTC
Removal commit is https://hg.libsdl.org/SDL/rev/6c2bbcfc3940
Comment 2 Sam Lantinga 2020-12-28 19:59:02 UTC
Hey Ryan, I think you broke this. What were you fixing with that commit?