mirror of
https://github.com/webmproject/libwebp.git
synced 2025-10-10 12:36:29 +02:00
Fix endianness with CMake.
Original patch from C. Neidahl. Change-Id: I734d7cb33c3da5abb8d4faf074277dba53b37147
This commit is contained in:
@@ -149,6 +149,16 @@ if(WIN32 AND BUILD_SHARED_LIBS)
|
||||
add_definitions(-DWEBP_DLL)
|
||||
endif()
|
||||
|
||||
# Compatibility with autoconf configure script's way of setting this
|
||||
if(CMAKE_C_BYTE_ORDER STREQUAL "BIG_ENDIAN")
|
||||
set(WORDS_BIGENDIAN TRUE)
|
||||
elseif(CMAKE_C_BYTE_ORDER STREQUAL "LITTLE_ENDIAN")
|
||||
set(WORDS_BIGENDIAN FALSE)
|
||||
else()
|
||||
set(WORDS_BIGENDIAN FALSE)
|
||||
message(WARNING "Endianness could not be determined.")
|
||||
endif()
|
||||
|
||||
# pkg-config variables used by *.pc.in.
|
||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set(exec_prefix "\${prefix}")
|
||||
|
@@ -108,12 +108,4 @@
|
||||
|
||||
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
|
||||
significant byte first (like Motorola and SPARC, unlike Intel). */
|
||||
#if defined AC_APPLE_UNIVERSAL_BUILD
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define WORDS_BIGENDIAN 1
|
||||
# endif
|
||||
#else
|
||||
# ifndef WORDS_BIGENDIAN
|
||||
# undef WORDS_BIGENDIAN
|
||||
# endif
|
||||
#endif
|
||||
#cmakedefine WORDS_BIGENDIAN 1
|
||||
|
Reference in New Issue
Block a user