Run-time check for integer byte order rather than CMake check.

It will easily be optimized out.
This commit is contained in:
Tsuda Kageyu
2015-08-03 13:08:58 +09:00
parent 44d9f2bf25
commit 076e845912
5 changed files with 6 additions and 36 deletions

View File

@ -1,7 +1,6 @@
include(CheckLibraryExists)
include(CheckTypeSize)
include(CheckCXXSourceCompiles)
include(TestBigEndian)
# Check if the size of numeric types are suitable.
@ -35,16 +34,6 @@ if(NOT ${SIZEOF_DOUBLE} EQUAL 8)
message(FATAL_ERROR "TagLib requires that double is 64-bit wide.")
endif()
# Determine the CPU byte order.
test_big_endian(IS_BIG_ENDIAN)
if(NOT IS_BIG_ENDIAN)
set(SYSTEM_BYTEORDER 1)
else()
set(SYSTEM_BYTEORDER 2)
endif()
# Determine which kind of atomic operations your compiler supports.
check_cxx_source_compiles("