From cbf0a21f05009e5fa94737a5b2872f96376c415c Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 7 Apr 2021 18:28:06 +1000 Subject: [PATCH] CMake: Enable 64-bit file offsets on 32-bit platforms --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 773b60295..61bf875e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -251,6 +251,13 @@ set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) +# Enable large file support on Linux 32-bit platforms. +# Android is deliberately ommitted here as it didn't support 64-bit ops on files until Android 7/N. +if((LINUX OR FREEBSD) AND (${CPU_ARCH} STREQUAL "x86" OR ${CPU_ARCH} STREQUAL "aarch32")) + add_definitions("-D_FILE_OFFSET_BITS=64") +endif() + + # Recursively include the source tree. enable_testing() add_subdirectory(dep)