[CMake] Re: OS X Universal Binary follow up

E. Wing ewmailing at gmail.com
Thu Dec 22 20:05:44 EST 2005


> So, it looks like they build main.o twice.  Once for ppc, and once for i386.
> Then the link a UniversalBinary for each ppc and i386.
> Next they run lipo and pass it both binaries, which creates the final
> executable.
>

Yes, I get the sense that the other way is a shortcut for people
modifying existing Makefiles/non-Xcode build systems so they don't
have to do as much work.

Now if you want to do the two pass method and manually invoke lipo, it
could potentially be a good thing for advanced usage cases. With SDL
right now, we're trying to build a Universal Binary, but the default
options invoke gcc 4.0 for both ppc and x86. The problem is that using
gcc 4.0 seems to create some dependencies/symbols that don't exist
prior to OS X 10.3.9. Currently, SDL works on 10.2 systems so it would
be a shame to give that up. We learned that some settings in Xcode
will allow you to invoke different versions of gcc for each
architecture. So we are experimenting with compiling x86 with gcc 4.0
(required), and ppc with gcc 3.3.

If CMake does the two pass approach also, I would encourage you to add
support for this kind of thing as well. (And separate CFLAGS to go
with each.)

Thanks,
Eric


More information about the CMake mailing list