Packaging static iOS libraries together on command line

126 Views Asked by At

I have a static iOS library built for armv7 and arm64, let's call it foo.a. It has dependencies on abc.a and def.a, which I have in armv7 and arm64 versions. I would like to package these together into one static library, so you can just use foo.a without having to include abc.a and def.a in your project.

In short, I would like to do something akin to

link arm64/abc.a arm64/def.a armv7/abc.a armv7/def.a foo.a -out foo.a

But I can't figure it which tool I'm supposed to use for this, or if I'm using them wrong. I've tried libtool, as such:

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

But I get the error message

Unrecognized option: '-static'

I've tried lipo

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

But I get the error message

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

I must be misunderstanding something fundamental about this process, but I'm having a hard time finding out what

0

There are 0 best solutions below