3

My question is : which is the correct way to release a compiled library for public use? OpenFeint for example release a single static Fat library (And source code too) How do they manage Release or Debug version ?

I'd like to understand how many version of my library i have to produce, i would be sure that users are free to choose how to import my library, and i think that a good solution could be compile and distribute these versions:

  • Release - Device
  • Release - Simulator
  • Release - Fat (device + simulator)
  • Debug - Device
  • Debug - Simulator
  • Debug - Fat (device + simulator)

What do you think about? How do you prefer to work with third party libs ?

Marcelo Cantos
  • 181,030
  • 38
  • 327
  • 365
MatterGoal
  • 16,038
  • 19
  • 109
  • 186
  • Why would you _not_ release a fat version only? –  Apr 20 '11 at 13:27
  • @Bavarious In case of a developer would build only for device and avoid to add simulator lib to the final executable i prefer to add every chance (but i'm not sure :P, for this reason i'm asking here ) – MatterGoal Apr 20 '11 at 13:43
  • That doesn’t make much sense. The simulator runs i386 code whereas the executable for the device would be armv6 or armv7 only. If the executable created by the linker is for one architecture only (e.g. armv6) and it is linking a fat (e.g armv6 + i386) static library, it links **only** the armv6 object files. –  Apr 20 '11 at 14:00
  • See this other question: [Build fat static library (device + simulator) using Xcode and SDK 4+](http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4). –  Apr 20 '11 at 14:04
  • ok! thank you i had the doubt that also lib for simulator came linked into device project. – MatterGoal Apr 20 '11 at 17:57

1 Answers1

5

Debug/Release

Definitely, you don't want people to be able to view symbols in your library. So don't worry with distributing a Debug build, people won't want to debug your own library.

Simulator/iOS/Fat

The compiler will automatically pick up the relevant "part" of a fat library. For instance, when you'll build an ARM binary, only the ARM part of your fat static lib will be embedded. So just go the "fat" route.

So, long story short : just distribute a fat, release version of your library !

Side note : if that is possible, please also distribute the source. From my personal experience, I'm very reluctant to add an "opaque" library to my projects.

Ecco
  • 1,323
  • 1
  • 11
  • 15