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

Summary: SDL_Init fails on iOS due to removed code from SDL_uikitappdelegate.m
Product: SDL Reporter: Steve Robinson <ssrobins>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: ASSIGNED --- QA Contact: Sam Lantinga <slouken>
Severity: blocker    
Priority: P2 CC: sezeroz
Version: 2.0.15Keywords: target-2.0.16
Hardware: ARM   
OS: macOS 10.15   

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?