1 # Check whether large files are supported
3 include(CheckCSourceCompiles)
6 SET(CMAKE_REQUIRED_DEFINITIONS -Werror-implicit-function-declaration)
8 list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE=1)
10 check_c_source_compiles("#include <fcntl.h>
14 int fd = open(\".\", O_RDONLY | O_LARGEFILE);
17 " HAVE_LARGEFILE_SUPPORT)
19 if (HAVE_LARGEFILE_SUPPORT)
20 add_definitions(-DHAVE_LARGEFILE_SUPPORT=1 -D_LARGEFILE64_SOURCE=1)
23 unset(CMAKE_REQUIRED_DEFINITIONS)
24 message(STATUS "Large file support found: ${HAVE_LARGEFILE_SUPPORT}")