在命令行

时间:2017-03-24 08:07:23

标签: ios static-linking lipo libtool-xcode

我有一个为armv7和arm64构建的静态iOS库,我们称之为foo.a.它依赖于abc.a和def.a,我在armv7和arm64版本中都有。我想将这些包装在一个静态库中,这样你就可以使用foo.a,而不必在项目中包含abc.a和def.a。

简而言之,我想做类似于

的事情
link arm64/abc.a arm64/def.a armv7/abc.a armv7/def.a foo.a -out foo.a

但我无法确定我应该使用哪种工具,或者我使用它们是错误的。我试过libtool,因此:

libtool -static arm64/abc.a arm64/def.a armv7/abc.a armv7/def.a foo.a -o foo.a

但我收到错误消息

Unrecognized option: '-static'

我尝试过脂肪

lipo -create -output foo.a arm64/abc.a arm64/def.a armv7/abc.a armv7/def.a foo.a

但我收到错误消息

fatal error: lipo: foo.a and armv7/abc.a have the same architecture (armv7) and can't be in the same fat output file

我一定是误解了这个过程的基本内容,但我很难找到什么

0 个答案:

没有答案