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 2302

Summary: Script to build SDL libs on IOS
Product: SDL Reporter: Sylvain <sylvain.becker>
Component: buildAssignee: Sam Lantinga <slouken>
Status: ASSIGNED --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: phil, philipp.wiesemann
Version: HG 2.1   
Hardware: x86_64   
OS: Linux   
Attachments: script : ios build libs
script to build SDL libs for IOS
script to build SDL libs for OSTV
script to build SDL libs for IOS
2269: script to build SDL libs for OSTV
script to build SDL libs for IOS
script to build SDL libs for IOS

Description Sylvain 2013-12-13 11:16:27 UTC
Created attachment 1496 [details]
script : ios build libs

Hello,

Here is a basic script to automatically build the SDL library and the satellite libs for IOS, configuration Debug/Release of Device/Simulator.

It expects the directory SDL/SDL_image/ttf/mixer in $HOME/release/Release_SDL_IOS  
and install the libs in $HOME/release/Release_SDL_IOS/SDL/{Debug,Release}-iphone{os,simulator}/

It saves me one hour each time I want to update to latest SDL version !
Comment 1 Sylvain 2015-09-21 12:56:11 UTC
Created attachment 2268 [details]
script to build SDL libs for IOS

This is an update of the previous script, so that it builds for arm64 and armv7 which are the architectures needed to publish on the AppStore.
Comment 2 Sylvain 2015-09-21 12:59:34 UTC
Created attachment 2269 [details]
script to build SDL libs for OSTV

Then, here's the same kind of script to build SDL libs for AppleTV / OSTV.

But, currently: 
- you need Xcode-beta 7.1 (installed in /Applications/Xcode-beta)
- SDL does not compile ... (no CoreMotion framework, some define are forbidden compared to IOS, ...)
Comment 3 Sylvain 2015-10-23 16:17:44 UTC
Created attachment 2289 [details]
script to build SDL libs for IOS

Update for xcode 7.1
Comment 4 Sylvain 2015-10-23 16:18:32 UTC
Created attachment 2290 [details]
2269: script to build SDL libs for OSTV

Update for xcode 7.1
Comment 5 Sylvain 2015-10-23 16:19:57 UTC
I have added an option "-fembed-bitcode" which is now required to publish on App Store. That is to to embed bitcode.
Comment 6 philhassey 2016-12-02 21:53:57 UTC
This was very helpful.

I found that I had to add "i386 x86_64" to SDL > Build Settings > Valid Architectures > to make proper simulator compatible builds for Xcode 8.1.

I added this line

lipo -create ./Release-iphoneos/libSDL2.a ./Release-iphonesimulator/libSDL2.a -output ./libSDL2.a

To create a universal (device and simulator) library.
Comment 7 Sylvain 2018-01-08 08:30:21 UTC
Created attachment 3125 [details]
script to build SDL libs for IOS

Updating the script
Comment 8 Sylvain 2020-08-23 19:57:06 UTC
Created attachment 4444 [details]
script to build SDL libs for IOS

Updating the script