2017-09-05 07:37:40 +02:00
|
|
|
project(minizip C)
|
|
|
|
|
2022-02-06 17:53:45 +01:00
|
|
|
add_library(minizip STATIC
|
2024-04-22 08:32:45 +02:00
|
|
|
minizip-ng/mz.h
|
|
|
|
minizip-ng/mz_compat.c
|
|
|
|
minizip-ng/mz_compat.h
|
|
|
|
minizip-ng/mz_crypt.c
|
|
|
|
minizip-ng/mz_crypt.h
|
|
|
|
minizip-ng/mz_os.c
|
|
|
|
minizip-ng/mz_os.h
|
|
|
|
minizip-ng/mz_strm.c
|
|
|
|
minizip-ng/mz_strm.h
|
|
|
|
minizip-ng/mz_strm_buf.c
|
|
|
|
minizip-ng/mz_strm_buf.h
|
2024-04-22 09:05:23 +02:00
|
|
|
# minizip-ng/mz_strm_bzip.c
|
|
|
|
# minizip-ng/mz_strm_bzip.h
|
|
|
|
# minizip-ng/mz_strm_libcomp.c
|
|
|
|
# minizip-ng/mz_strm_libcomp.h
|
|
|
|
# minizip-ng/mz_strm_lzma.c
|
|
|
|
# minizip-ng/mz_strm_lzma.h
|
2024-04-22 08:32:45 +02:00
|
|
|
minizip-ng/mz_strm_mem.c
|
|
|
|
minizip-ng/mz_strm_mem.h
|
|
|
|
minizip-ng/mz_strm_os.h
|
2024-04-22 09:05:23 +02:00
|
|
|
# minizip-ng/mz_strm_pkcrypt.c
|
|
|
|
# minizip-ng/mz_strm_pkcrypt.h
|
2024-04-22 08:32:45 +02:00
|
|
|
minizip-ng/mz_strm_split.c
|
|
|
|
minizip-ng/mz_strm_split.h
|
2024-04-22 09:05:23 +02:00
|
|
|
# minizip-ng/mz_strm_wzaes.c
|
|
|
|
# minizip-ng/mz_strm_wzaes.h
|
2024-04-22 08:32:45 +02:00
|
|
|
minizip-ng/mz_strm_zlib.c
|
|
|
|
minizip-ng/mz_strm_zlib.h
|
2024-04-22 09:05:23 +02:00
|
|
|
# minizip-ng/mz_strm_zstd.c
|
|
|
|
# minizip-ng/mz_strm_zstd.h
|
2024-04-22 08:32:45 +02:00
|
|
|
minizip-ng/mz_zip.c
|
|
|
|
minizip-ng/mz_zip.h
|
|
|
|
minizip-ng/mz_zip_rw.c
|
|
|
|
minizip-ng/mz_zip_rw.h
|
2022-02-06 17:53:45 +01:00
|
|
|
)
|
2024-03-19 07:08:54 +01:00
|
|
|
dolphin_disable_warnings(minizip)
|
2022-02-06 17:53:45 +01:00
|
|
|
|
|
|
|
if (UNIX)
|
|
|
|
target_sources(minizip PRIVATE
|
2024-04-22 08:32:45 +02:00
|
|
|
minizip-ng/mz_os_posix.c
|
|
|
|
minizip-ng/mz_strm_os_posix.c
|
2022-02-06 17:53:45 +01:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
target_sources(minizip PRIVATE
|
2024-04-22 08:32:45 +02:00
|
|
|
minizip-ng/mz_os_win32.c
|
|
|
|
minizip-ng/mz_strm_os_win32.c
|
2022-02-06 17:53:45 +01:00
|
|
|
)
|
2017-09-05 07:37:40 +02:00
|
|
|
endif()
|
|
|
|
|
2024-04-22 09:05:23 +02:00
|
|
|
# Unused files
|
2024-04-22 09:14:34 +02:00
|
|
|
# minizip-ng/minigzip.c
|
|
|
|
# minizip-ng/minizip.c
|
2024-04-22 09:05:23 +02:00
|
|
|
# minizip-ng/mz_crypt_apple.c
|
|
|
|
# minizip-ng/mz_crypt_openssl.c
|
2024-04-22 09:14:34 +02:00
|
|
|
# minizip-ng/mz_crypt_winvista.c
|
|
|
|
# minizip-ng/mz_crypt_winxp.c
|
2024-04-22 09:05:23 +02:00
|
|
|
|
2024-04-22 08:32:45 +02:00
|
|
|
target_include_directories(minizip PUBLIC minizip-ng)
|
2017-09-05 07:37:40 +02:00
|
|
|
|
2022-02-06 17:53:45 +01:00
|
|
|
target_compile_definitions(minizip PRIVATE HAVE_ZLIB ZLIB_COMPAT MZ_ZIP_NO_CRYPTO MZ_ZIP_NO_ENCRYPTION)
|
|
|
|
if (UNIX)
|
|
|
|
target_compile_definitions(minizip PRIVATE _POSIX_C_SOURCE=200112L)
|
|
|
|
target_compile_definitions(minizip PRIVATE __USE_LARGEFILE64 _LARGEFILE64_SOURCE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
check_include_file(stdint.h HAVE_STDINT_H)
|
|
|
|
if (HAVE_STDINT_H)
|
|
|
|
target_compile_definitions(minizip PRIVATE HAVE_STDINT_H)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
check_include_file(inttypes.h HAVE_INTTYPES_H)
|
|
|
|
if (HAVE_INTTYPES_H)
|
|
|
|
target_compile_definitions(minizip PRIVATE HAVE_INTTYPES_H)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
check_function_exists(fseeko HAVE_FSEEKO)
|
|
|
|
if (NOT HAVE_FSEEKO)
|
|
|
|
target_compile_definitions(minizip PRIVATE NO_FSEEKO)
|
|
|
|
endif()
|
|
|
|
|
2020-06-05 23:01:16 +02:00
|
|
|
target_link_libraries(minizip PUBLIC ZLIB::ZLIB)
|
2019-05-08 20:58:16 +02:00
|
|
|
|
2023-04-16 07:57:34 +02:00
|
|
|
add_library(minizip::minizip ALIAS minizip)
|