如何分发静态库? [英] How to distribute Static libraries?

查看:29
本文介绍了如何分发静态库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是:发布已编译库供公众使用的正确方法是什么?例如 OpenFeint 发布单个静态 Fat 库(还有源代码)他们如何管理发布或调试版本?

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:

  • 发布 - 设备
  • 发布 - 模拟器
  • 发布 - Fat(设备 + 模拟器)
  • 调试 - 设备
  • 调试 - 模拟器
  • 调试 - 胖(设备 + 模拟器)

你怎么看?您更喜欢如何使用第三方库?

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

推荐答案

调试/发布

当然,您不希望人们能够查看您库中的符号.所以不要担心分发调试版本,人们不会想要调试你自己的库.

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.

模拟器/iOS/Fat

编译器会自动选取胖库的相关部分".例如,当您构建一个 ARM 二进制文件时,只会嵌入您的胖静态库的 ARM 部分.所以就走胖"路线.

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.

这篇关于如何分发静态库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆