How to distribute Static libraries?

可紊 提交于 2019-12-12 12:26:28

问题


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 ?


回答1:


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.



来源:https://stackoverflow.com/questions/5730432/how-to-distribute-static-libraries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!