From 17fdc454371ed93d74160efa9df5cb19081b6cdd Mon Sep 17 00:00:00 2001 From: Jens Verwiebe Date: Tue, 7 Aug 2012 13:51:19 +0000 Subject: OSX/cmake: refactoring of setting endianess defines, this fixes compile of builds with endianess other than the buildmachine and avoids also failing configuration with xcode 4.4 due not supporting big_endian archs anymore --- CMakeLists.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f363809424..bc08f6f5ad9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1483,11 +1483,16 @@ endif() if(MSVC) # for some reason this fails on msvc add_definitions(-D__LITTLE_ENDIAN__) -elseif(APPLE) - if (${XCODE_VERSION} VERSION_GREATER 4.3) - # no more ppc support in xcode > 4.3 - add_definitions(-D__LITTLE_ENDIAN__) - endif() + +# OSX-Note: as we do crosscompiling with specific set architecture, +# endianess-detection and autosetting is counterproductive +# so we just set endianess according CMAKE_OSX_ARCHITECTURES + +elseif(CMAKE_OSX_ARCHITECTURES MATCHES i386 OR CMAKE_OSX_ARCHITECTURES MATCHES x86_64) + add_definitions(-D__LITTLE_ENDIAN__) +elseif(CMAKE_OSX_ARCHITECTURES MATCHES ppc OR CMAKE_OSX_ARCHITECTURES MATCHES ppc64) + add_definitions(-D__BIG_ENDIAN__) + else() include(TestBigEndian) test_big_endian(_SYSTEM_BIG_ENDIAN) -- cgit v1.2.3