[poppler] ConfigureChecks.cmake

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 15 23:16:52 UTC 2019


 ConfigureChecks.cmake |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 842a75d8d6cc0105da6c0b5dbb0997b79ba63246
Author: Volker Krause <vkrause at kde.org>
Date:   Tue Jan 15 19:50:39 2019 +0100

    Fix fseeko configure check on Android for API level < 24
    
    The availability depends on the _FILE_OFFSET_BITS define, which is set
    in config.h. So we need to have this during the configure check as well,
    to test under the same conditions.

diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index fa0f1403..2532f805 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -11,6 +11,13 @@ include(CheckFunctionExists)
 include(CheckLibraryExists)
 include(CheckTypeSize)
 include(CheckCSourceCompiles)
+include(CMakePushCheckState)
+
+cmake_push_check_state()
+# this is going to be defined via config.h, and impacts Android's stdio.h
+if (_FILE_OFFSET_BITS)
+  set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_FILE_OFFSET_BITS=${_FILE_OFFSET_BITS})
+endif()
 
 check_include_files(dlfcn.h HAVE_DLFCN_H)
 check_include_files(fcntl.h HAVE_FCNTL_H)
@@ -21,7 +28,7 @@ check_include_files(unistd.h HAVE_UNISTD_H)
 check_include_file_cxx(codecvt HAVE_CODECVT)
 
 check_function_exists(fseek64 HAVE_FSEEK64)
-check_function_exists(fseeko HAVE_FSEEKO)
+check_symbol_exists(fseeko "stdio.h" HAVE_FSEEKO)
 check_function_exists(ftell64 HAVE_FTELL64)
 check_function_exists(pread64 HAVE_PREAD64)
 check_function_exists(lseek64 HAVE_LSEEK64)
@@ -55,3 +62,5 @@ check_function_exists("nanosleep" HAVE_NANOSLEEP)
 if(NOT HAVE_NANOSLEEP)
   check_library_exists("rt" "nanosleep" "" LIB_RT_HAS_NANOSLEEP)
 endif(NOT HAVE_NANOSLEEP)
+
+cmake_pop_check_state()


More information about the poppler mailing list