[Stk] iOS static library

Ariel Elkin arielelkin at gmail.com
Sat Mar 8 10:14:49 PST 2014


Hello all, 

I’ve updated the pull request so that the iOS static library compiles all source files. No more cumbersome cherry-picking. Build once, let the linker do the cherry-picking, as Richard suggested. 
https://github.com/thestk/stk/pull/8

Check out its updated read me file:
https://github.com/arielelkin/stk/blob/ios_lib/STK%20for%20iOS/README.md

I have two issues I could use some feedback on now: 

1) Is there a particular C dialect I should chose for it? The current choice is GNU11, but these options are also available: 
https://developer.apple.com/legacy/library/documentation/DeveloperTools/gcc-4.2.1/gcc/C-Dialect-Options.html

2) As you can see from the Readme’s troubleshooting section on Raw waves, 
https://github.com/arielelkin/stk/blob/ios_lib/STK%20for%20iOS/README.md#raw-waves

I’m having some trouble having the STK automatically set the RAWWAVE_PATH macro. Basically, when running on iOS, we need RAWWAVE_PATH to be set to:
[[[NSBundle bundleWithURL:[[NSBundle mainBundle] URLForResource:@"rawwaves" withExtension:@"bundle"]] resourcePath] UTF8String]

but this can only be resolved at runtime, and correct me if I’m wrong, this means I can’t do that with an #ifdef. So now I’m just setting it manually by calling Stk::setRawwavePath at runtime. 

Is there a way to have the STK automatically set the raw wave path to the raw wave bundle? 

Cheers

Ariel

On 4 Mar 2014, at 19:17, Perry R Cook <prc at cs.princeton.edu> wrote:

> Yay!!  Then it seems we have a pretty good solution.
> Save for the waiting for a clean and build, building
> the whole library seems like the best way.  Then 
> naive programmers don't have to do lots of inheritance
> traversing to see what to compile, (just includes in
> their own code).  
> 
> This is really great!  Thanks for doing this all.
> 
> PRC
> 
> ----- Original Message -----
> ..
> 
> Unless gcc/Xcode is really dumb (which I don't think it is), it will not 
> link the whole of a static library with an app regardless - only the 
> functions the app actually uses, i.e. the linker does the cherry-picking 
> itself. The linker/compiler also does a standard "dead code elimination" 
> step when compiling/optimising, so even the code you have written in the 
> app but which never gets called is also excluded. So I just built  the 
> whole of the stk as a static library (minus the redundant bits such as 
> direct audio i/o). So - my stk static library runs out at some 9MB, but 
> my test iOS app, which uses only a small part of it, is under 500K.
> 
> Richard Dobson
> 
> _______________________________________________
> Stk mailing list
> Stk at ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/stk
> 
> _______________________________________________
> Stk mailing list
> Stk at ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/stk




More information about the Stk mailing list