Detect if system is big endian (e.g. PPC64)

This commit is contained in:
Jan Vidar Krey 2013-02-20 00:28:43 +01:00
parent d48ef710d8
commit 50e720861e
1 changed files with 13 additions and 1 deletions

View File

@ -16,6 +16,7 @@ set (PROJECT_SOURCE_DIR "${CMAKE_SOURCE_DIR}/src")
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/Modules) set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/Modules)
option(RELEASE "Release build, debug build if disabled" ON) option(RELEASE "Release build, debug build if disabled" ON)
option(LOWLEVEL_DEBUG, "Enable low level debug messages." OFF)
option(LINK_SUPPORT "Allow hub linking" OFF) option(LINK_SUPPORT "Allow hub linking" OFF)
option(SSL_SUPPORT "Enable SSL support" ON) option(SSL_SUPPORT "Enable SSL support" ON)
option(USE_OPENSSL "Use OpenSSL's SSL support" ON ) option(USE_OPENSSL "Use OpenSSL's SSL support" ON )
@ -25,6 +26,13 @@ option(ADC_STRESS "Enable the stress tester client" OFF)
find_package(Git) find_package(Git)
find_package(Sqlite3) find_package(Sqlite3)
include(TestBigEndian)
TEST_BIG_ENDIAN(BIGENDIAN)
if (BIGENDIAN)
add_definitions(-DARCH_BIGENDIAN)
endif()
if (SSL_SUPPORT) if (SSL_SUPPORT)
if (USE_OPENSSL) if (USE_OPENSSL)
find_package(OpenSSL) find_package(OpenSSL)
@ -200,7 +208,11 @@ if (RELEASE)
add_definitions(-DNDEBUG) add_definitions(-DNDEBUG)
else() else()
set(CMAKE_BUILD_TYPE Debug) set(CMAKE_BUILD_TYPE Debug)
# add_definitions(-DDEBUG) add_definitions(-DDEBUG)
endif()
if (LOWLEVEL_DEBUG)
add_definitions(-DLOWLEVEL_DEBUG)
endif() endif()
if (UNIX) if (UNIX)