Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Verwiebe <info@jensverwiebe.de>2012-08-07 17:51:19 +0400
committerJens Verwiebe <info@jensverwiebe.de>2012-08-07 17:51:19 +0400
commit17fdc454371ed93d74160efa9df5cb19081b6cdd (patch)
treee8841cf4b7691fa842c9a563c9b9a4bf03682f3e /CMakeLists.txt
parent719aedaf60ecbf2108117d9377acb2f1614cc7cd (diff)
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
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
1 files changed, 10 insertions, 5 deletions
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)