2017-09-04 23:37:40 -06:00
|
|
|
project(minizip C)
|
|
|
|
|
2022-02-06 09:53:45 -07:00
|
|
|
add_library(minizip STATIC
|
|
|
|
mz.h
|
|
|
|
mz_compat.c
|
|
|
|
mz_compat.h
|
|
|
|
mz_crypt.c
|
|
|
|
mz_crypt.h
|
|
|
|
mz_os.c
|
|
|
|
mz_os.h
|
|
|
|
mz_strm.c
|
|
|
|
mz_strm.h
|
|
|
|
mz_strm_buf.c
|
|
|
|
mz_strm_buf.h
|
|
|
|
mz_strm_mem.c
|
|
|
|
mz_strm_mem.h
|
|
|
|
mz_strm_os.h
|
|
|
|
mz_strm_split.c
|
|
|
|
mz_strm_split.h
|
|
|
|
mz_strm_zlib.c
|
|
|
|
mz_strm_zlib.h
|
|
|
|
mz_zip.c
|
|
|
|
mz_zip.h
|
|
|
|
mz_zip_rw.c
|
|
|
|
mz_zip_rw.h
|
|
|
|
unzip.h
|
|
|
|
zip.h
|
|
|
|
)
|
2022-05-21 07:09:05 -06:00
|
|
|
dolphin_disable_warnings_msvc(minizip)
|
2022-02-06 09:53:45 -07:00
|
|
|
|
|
|
|
if (UNIX)
|
|
|
|
target_sources(minizip PRIVATE
|
|
|
|
mz_os_posix.c
|
|
|
|
mz_strm_os_posix.c
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
target_sources(minizip PRIVATE
|
|
|
|
mz_os_win32.c
|
|
|
|
mz_strm_os_win32.c
|
|
|
|
)
|
2017-09-04 23:37:40 -06:00
|
|
|
endif()
|
|
|
|
|
|
|
|
target_include_directories(minizip PUBLIC .)
|
|
|
|
|
2022-02-06 09:53:45 -07: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 15:01:16 -06:00
|
|
|
target_link_libraries(minizip PUBLIC ZLIB::ZLIB)
|
2019-05-08 12:58:16 -06:00
|
|
|
|
2023-04-15 23:57:34 -06:00
|
|
|
add_library(minizip::minizip ALIAS minizip)
|