diff --git a/3rdparty/libzip/CMakeLists.txt b/3rdparty/libzip/CMakeLists.txt index 93b46a61e7099f96afd31ad77dd29de0a9a7b30a..38a54f1a44ad3e3580dab9faae1dd58bdd7aaa30 100644 --- a/3rdparty/libzip/CMakeLists.txt +++ b/3rdparty/libzip/CMakeLists.txt @@ -9,7 +9,9 @@ project(libzip VERSION 1.8.0 LANGUAGES C) -option(ENABLE_COMMONCRYPTO "Enable use of CommonCrypto" ON) +if(LINUX) + option(ENABLE_COMMONCRYPTO "Enable use of CommonCrypto" ON) +endif() option(ENABLE_GNUTLS "Enable use of GnuTLS" ON) option(ENABLE_MBEDTLS "Enable use of mbed TLS" ON) option(ENABLE_OPENSSL "Enable use of OpenSSL" ON) @@ -19,10 +21,10 @@ option(ENABLE_BZIP2 "Enable use of BZip2" ON) option(ENABLE_LZMA "Enable use of LZMA" ON) option(ENABLE_ZSTD "Enable use of Zstandard" ON) -option(BUILD_TOOLS "Build tools in the src directory (zipcmp, zipmerge, ziptool)" ON) -option(BUILD_REGRESS "Build regression tests" ON) -option(BUILD_EXAMPLES "Build examples" ON) -option(BUILD_DOC "Build documentation" ON) +#option(BUILD_TOOLS "Build tools in the src directory (zipcmp, zipmerge, ziptool)" ON) +#option(BUILD_REGRESS "Build regression tests" ON) +#option(BUILD_EXAMPLES "Build examples" ON) +#option(BUILD_DOC "Build documentation" ON) include(CheckFunctionExists) include(CheckIncludeFiles) @@ -54,10 +56,10 @@ if(WIN32) endif() endif() -option(BUILD_SHARED_LIBS "Build shared libraries" ON) +#option(BUILD_SHARED_LIBS "Build shared libraries" ON) option(LIBZIP_DO_INSTALL "Install libzip and the related files" ON) -option(SHARED_LIB_VERSIONNING "Add SO version in .so build" ON) +#option(SHARED_LIB_VERSIONNING "Add SO version in .so build" ON) find_program(MDOCTOOL NAMES mandoc groff) if (MDOCTOOL) diff --git a/3rdparty/libzip/lib/compat.h b/3rdparty/libzip/lib/compat.h index 47c28fde91ba69d1688e54af245ec0bca4517f2b..d9179571fcc55352c2229fa4dc3ff805742ceb80 100644 --- a/3rdparty/libzip/lib/compat.h +++ b/3rdparty/libzip/lib/compat.h @@ -117,13 +117,13 @@ typedef char bool; #endif #endif -#ifndef HAVE_FSEEKO -#define fseeko(s, o, w) (fseek((s), (long int)(o), (w))) -#endif +// #ifndef HAVE_FSEEKO +// #define fseeko(s, o, w) (fseek((s), (long int)(o), (w))) +// #endif -#ifndef HAVE_FTELLO -#define ftello(s) ((long)ftell((s))) -#endif +// #ifndef HAVE_FTELLO +// #define ftello(s) ((long)ftell((s))) +// #endif #if !defined(HAVE_STRCASECMP) #if defined(HAVE__STRICMP) @@ -143,16 +143,18 @@ typedef char bool; #define ZIP_OFF_MAX ZIP_INT16_MAX #define ZIP_OFF_MIN ZIP_INT16_MIN #else -#error unsupported size of off_t +#define SIZEOF_OFF_T == 8 +#define ZIP_OFF_MAX ZIP_INT64_MAX +#define ZIP_OFF_MIN ZIP_INT64_MIN #endif #if defined(HAVE_FTELLO) && defined(HAVE_FSEEKO) #define ZIP_FSEEK_MAX ZIP_OFF_MAX #define ZIP_FSEEK_MIN ZIP_OFF_MIN #else -#include <limits.h> -#define ZIP_FSEEK_MAX LONG_MAX -#define ZIP_FSEEK_MIN LONG_MIN +// #include <limits.h> +#define ZIP_FSEEK_MAX ZIP_OFF_MAX +#define ZIP_FSEEK_MIN ZIP_OFF_MIN #endif #ifndef SIZE_MAX diff --git a/CMakeLists.txt b/CMakeLists.txt index 4399c735465b9ee38dd0d678999b0fb36ffd8404..aed801d20f30a4a8e146210d71d704817a9ca9d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,10 +93,8 @@ if (ANDROID) endif() if (BUILD_WITH_ZIP) - if(LINUX) - add_subdirectory(3rdparty/libzip) - include_directories(3rdparty/libzip/lib) - endif() + add_subdirectory(3rdparty/libzip) + include_directories(3rdparty/libzip/lib) endif() add_subdirectory(dap-sdk)