Search code examples
xcodemacosstatic-librariesstatic-linking

Creating a static library of static libraries in XCode


I have a need to create a static library which will some of it's own code and it will also contain a number of other static libraries I have written.

So normally I have a main project A.xcodeproj which depends on B.xcodeproj which in turn depends on C, D, E etc.

My company has a requirement to distribute only a static library with a simple app, and for there to only be one library sent out, not a multitude of libC.a libD.a etc.

So I create A_static.xcodeproj which has simple application API calls and links to libB.a but everytime I try this libB.a only contains the symbols for B.xcodeproj, I can not get to it also contain libC.a libD.a etc.

Is there an easy way to do this in XCode that I'm missing?

Thanks


Solution

  • It sounds very much like you need to use frameworks. Allows you to bundle multiple libraries and files together into 1 bundle that other parties can include. I'm in the same boat where I work. I've used this guide on github to get our frameworks up and running. Worked great for me.

    iOS Framework