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 5481 - iOS-specific main sources not used for CMake build.
Summary: iOS-specific main sources not used for CMake build.
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: main (show other bugs)
Version: 2.0.14
Hardware: iPhone/iPod touch iOS 11
: P2 major
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-19 03:58 UTC by Aaron Barany
Modified: 2021-01-26 04:43 UTC (History)
0 users

See Also:


Attachments
sdl-ios-fix.patch (629 bytes, patch)
2021-01-25 02:19 UTC, Aaron Barany
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Barany 2021-01-19 03:58:32 UTC
The CMake build for SDL doesn't set SDLMAIN_SOURCES on iOS to the sources in src/main/ios. As a result, SDL fails to initialize since it falls back to the dummy main. Adding the line file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/uikit/*.c) fixes the issue.
Comment 1 Sam Lantinga 2021-01-23 17:39:23 UTC
Can you provide a tested patch?

Thanks!
Comment 2 Aaron Barany 2021-01-25 02:19:34 UTC
Created attachment 4703 [details]
sdl-ios-fix.patch

I've attached the patch I'm using to fix the iOS build. The fix for the main library was integrated into a separate patch for fixing the misc sources that was posted on another bug.
Comment 3 Sam Lantinga 2021-01-26 04:43:49 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL/rev/399606b401c9