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

后端 未结 1 1440
忘掉有多难
忘掉有多难 2021-02-04 21:09

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?

1条回答
  •  梦如初夏
    2021-02-04 21:31

    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.

    0 讨论(0)
提交回复
热议问题