且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Mac OS X上编译通用库?

更新时间:2023-09-30 10:27:46

Finally got it working.

In order to control the architecture of the target, I manually went in and edited the Makefiles.

For one of them, I added to the end of the line that starts with CFLAGS: -arch i386 -arch x86_64 -arch ppc This produced a universal binary.

For the other, when I did the same thing, the compile would error out. I had to cycle through and only put one arch at a time, and then after I produced all three, I called lipo on them with the -create flag to create a universal binary.