[CMake] OSX universal binary support

Sean McBride sean at rogue-research.com
Tue Jan 15 10:10:56 EST 2008


On 1/15/08 9:59 AM, Mike Jackson said:

In addition to what other's said, I'll just add the following:

>Funny.. last time I asked I was told to use "i386 ppc" which did not  
>work and so I started adding the flags myself. Using a ";" instead of  
>a space does allow universal binaries to be produced.

CMake also supports building 4-way fat by specifying "i386;ppc;ppc64;x86_64".

>Of course one has to be careful when doing this with endian specific  
>code. Have both PPC and i386 is basically cross compiling and trying  
>to determine the proper byte ordering of the target machine is prone  
>to errors. Just FYI for those with this type of code.

It is best to avoid any TRY_RUN if you want to build universal. 
Instead, you can check endianness at compile time (the compiler knows
the endianness of the machine its building for of course).  You can use
#if __BIG_ENDIAN__ (something like that).

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada



More information about the CMake mailing list