diff --git a/3rdparty/libtiff/CMakeLists.txt b/3rdparty/libtiff/CMakeLists.txt index ae9914b3e8..73717e20c0 100644 --- a/3rdparty/libtiff/CMakeLists.txt +++ b/3rdparty/libtiff/CMakeLists.txt @@ -244,10 +244,14 @@ mark_as_advanced(HAVE_IEEEFP) # Large file support if(UNIX OR MINGW) - # This might not catch every possibility catered for by - # AC_SYS_LARGEFILE. - add_definitions(-D_FILE_OFFSET_BITS=64) - set(FILE_OFFSET_BITS 64) + if(ANDROID AND (ANDROID_NATIVE_API_LEVEL LESS 21) AND (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES Clang)) + # Android NDK build problem: 'mmap' issue with GCC and API<21 + else() + # This might not catch every possibility catered for by + # AC_SYS_LARGEFILE. + add_definitions(-D_FILE_OFFSET_BITS=64) + set(FILE_OFFSET_BITS 64) + endif() endif() # Documentation install directory (default to cmake project docdir) diff --git a/3rdparty/libtiff/tif_config.h.cmake.in b/3rdparty/libtiff/tif_config.h.cmake.in index de0f3a3c2c..492636ec92 100644 --- a/3rdparty/libtiff/tif_config.h.cmake.in +++ b/3rdparty/libtiff/tif_config.h.cmake.in @@ -245,9 +245,6 @@ # endif #endif -/* Number of bits in a file offset, on hosts where this is settable. */ -#define _FILE_OFFSET_BITS @FILE_OFFSET_BITS@ - /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus