From cec341c6b66fb38d30bfe96db4af6ce1ae970108 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Fri, 3 Jan 2025 10:37:50 +0100 Subject: [PATCH] Disable posix fallocate on Android --- CMakeLists.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index df297e0cb7..b7aaf202fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -249,11 +249,14 @@ if(UNIX) set(CMAKE_REQUIRED_DEFINITIONS "-D_LARGEFILE_SOURCE" "-D_LARGEFILE64_SOURCE") # Use readdir64 if available. check_symbol_exists(readdir64 "dirent.h" REALM_HAVE_READDIR64) - cmake_reset_check_state() - set(CMAKE_REQUIRED_DEFINITIONS "-D_POSIX_C_SOURCE=200112L") - check_symbol_exists(posix_fallocate "fcntl.h" REALM_HAVE_POSIX_FALLOCATE) - if(REALM_HAVE_POSIX_FALLOCATE) - add_compile_definitions("_POSIX_C_SOURCE=200112L") + + if(NOT ANDROID) + cmake_reset_check_state() + set(CMAKE_REQUIRED_DEFINITIONS "-D_POSIX_C_SOURCE=200112L") + check_symbol_exists(posix_fallocate "fcntl.h" REALM_HAVE_POSIX_FALLOCATE) + if(REALM_HAVE_POSIX_FALLOCATE) + add_compile_definitions("_POSIX_C_SOURCE=200112L") + endif() endif() cmake_pop_check_state() endif()