Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a universal dylib from pre-built dylibs for each architecture?

Tags:

cocoa

xcode5

For another universal library I need to combine 2 existing dylibs (here x86 and x64) into a single universal lib. How can I do that without re-building the existing libraries?

like image 354
Mike Lischke Avatar asked Apr 01 '14 10:04

Mike Lischke


1 Answers

Actually, it's extremely easy to do once you know it. There's a tool called lipo that can do a number of things with dylibs. One is to combine two (or more) libraries. For example:

lipo lib1.dylib lib2.dylib -output combined.dylib -create

where lib1 could be an i386 and lib2 an x86_64 arch type. It will create a dylib in the local folder containing both archs.

like image 94
Mike Lischke Avatar answered Nov 13 '22 10:11

Mike Lischke