[CMake] Configure Mac OS X for 32-bit

Sean McBride sean at rogue-research.com
Mon May 3 12:11:23 EDT 2010


On Mon, 3 May 2010 09:59:36 -0600, Karl Merkley said:

>I just read through this entire thread and I would like to expand it a
>little.   Regardless of platform, what is the right way to determine the
>right build architecture?  I run on a 32 bit Linux box but I use distcc
>which distributes the build to some 64 bit machines.    I always just
>edit the CMakeCache.txt manually and add the -m32 flag.    Some of my
>customers don't like that approach and would like to automate the
>decision for Mac, Linux and Windows.    So I need to determine is that
>platform that cmake runs on 32 bit or 64 bit and then set the correct
>flags for each platform.    

For Mac anyway, the 32/64 'bitness' of the building machine is
irrelevant.  PPC Macs can build Intel code, 32 bit Macs can build 64 bit
code, and vice versa, and etc.

Your code needs to be written such that it 1) supports both endiannesses
2) understands both 32 and 64 bit pointers 3) doesn't make invalid
assumptions about the size of int, long, void*, etc.  Only if your code
is properly written can it be built as either 32 or 64 bit.  Then I
guess the person doing the building also has to decide which kinds of
machines he's building for.

-- 
____________________________________________________________
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