| Summary: | SDL_Init fails on iOS due to removed code from SDL_uikitappdelegate.m | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Steve Robinson <ssrobins> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | blocker | ||
| Priority: | P2 | CC: | sezeroz |
| Version: | 2.0.15 | Keywords: | target-2.0.16 |
| Hardware: | ARM | ||
| OS: | macOS 10.15 | ||
Removal commit is https://hg.libsdl.org/SDL/rev/6c2bbcfc3940 Hey Ryan, I think you broke this. What were you fixing with that commit? |
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