[CMake] Adding cross-compiler support to CMake ...

Benjamin Reed rangerrick at gmail.com
Mon Sep 11 14:28:16 EDT 2006


On 9/11/06, Brandon J. Van Every <bvanevery at gmail.com> wrote:

> Hrm.  I wanted to say that CMake should treat a Universal binary as
> multiple targets.  But if gcc treats them as a single target, that's not
> possible.  Sticky wicket.  Suppress Endian checks on MacOS X?

Basically.  Although you'll still need to check __BIG_ENDIAN__ on OSX;
so somewhere the code needs to know at preprocessor-time.

It's ugly, but this is what we used for dbus's (ew, autoconf) check:

---(snip!)---
## byte order
case $host_os in
        darwin*)
                # check at compile-time, so that it is possible to
build universal
                # (with multiple architectures at once on the compile line)
                AH_VERBATIM([WORDS_BIGENDIAN_DARWIN], [
                        /* Use the compiler-provided endianness
defines to allow universal compiling. */
                        #if defined(__BIG_ENDIAN__)
                        #define WORDS_BIGENDIAN 1
                        #endif
                ])
                ;;
        *)
                AC_C_BIGENDIAN
                ;;
esac
---(snip!)---

That goes right into config.h.


More information about the CMake mailing list