aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorVasyl Gello <vasek.gello@gmail.com>2021-01-23 18:04:00 +0200
committerVasyl Gello <vasek.gello@gmail.com>2021-10-19 08:33:45 +0000
commit8f1d1e25a9b48b80e880a32fad6a4231f048b83f (patch)
tree8ba40436f1c71773412b64184b37eed0f69ebac0 /cmake
parent722859d8da29a58bea445afa7f53808be9012d52 (diff)
Detect and honor big-endian architectures
Fixes #19109 CMake detects the endianness using TestBigEndian.cmake module and adds the -DWORDS_BIGENDIAN=${WORDS_BIGENDIAN} definition to architecture-specific definitions. Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/scripts/linux/ArchSetup.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmake/scripts/linux/ArchSetup.cmake b/cmake/scripts/linux/ArchSetup.cmake
index b68efe3bd0..9343aa1cf4 100644
--- a/cmake/scripts/linux/ArchSetup.cmake
+++ b/cmake/scripts/linux/ArchSetup.cmake
@@ -130,3 +130,13 @@ endif()
if(ENABLE_VDPAU)
set(ENABLE_GLX ON CACHE BOOL "Enabling GLX" FORCE)
endif()
+
+# Architecture endianness detector
+include(TestBigEndian)
+TEST_BIG_ENDIAN(ARCH_IS_BIGENDIAN)
+if(ARCH_IS_BIGENDIAN)
+ message(STATUS "Host architecture is big-endian")
+ list(APPEND ARCH_DEFINES "-DWORDS_BIGENDIAN=1")
+else()
+ message(STATUS "Host architecture is little-endian")
+endif()