Skip to content

Commit

Permalink
Disable posix fallocate on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev committed Jan 3, 2025
1 parent fd96376 commit cec341c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit cec341c

Please sign in to comment.