minizip-ng: Properly use libraries from Externals

This also fixes the CMake build on Windows, since it would fail to find our target defined in Externals and would fall back to trying to redefine it, which produces an error.
This commit is contained in:
Joshua Vandaële
2025-12-24 04:59:08 +01:00
parent 11065e9911
commit 4af06fd487
2 changed files with 42 additions and 9 deletions
+35
View File
@@ -3,7 +3,42 @@ set(MZ_BUILD_TESTS OFF)
set(MZ_BUILD_UNIT_TESTS OFF)
set(MZ_BUILD_FUZZ_TESTS OFF)
set(MZ_CODE_COVERAGE OFF)
set(MZ_FETCH_LIBS OFF)
set(MZ_BZIP2 OFF)
set(MZ_PKCRYPT OFF)
set(MZ_WZAES OFF)
set(MZ_OPENSSL OFF)
set(MZ_LIBBSD OFF)
set(SKIP_INSTALL_ALL ON)
if(Iconv_TYPE STREQUAL Bundled)
set(CMAKE_DISABLE_FIND_PACKAGE_Iconv TRUE)
set(Iconv_FOUND TRUE)
set(Iconv_LIBRARIES Iconv::Iconv)
get_target_property(Iconv_INCLUDE_DIRS ${Iconv_LIBRARIES} INTERFACE_INCLUDE_DIRECTORIES)
endif()
if(LibLZMA_TYPE STREQUAL Bundled)
set(CMAKE_DISABLE_FIND_PACKAGE_LibLZMA TRUE)
set(LIBLZMA_FOUND TRUE)
set(LIBLZMA_LIBRARIES LibLZMA::LibLZMA)
get_target_property(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_LIBRARIES} INTERFACE_INCLUDE_DIRECTORIES)
endif()
if(ZLIB_TYPE STREQUAL Bundled)
set(CMAKE_DISABLE_FIND_PACKAGE_ZLIB TRUE)
set(ZLIB_FOUND TRUE)
set(ZLIB_LIBRARIES ZLIB::ZLIB)
get_target_property(ZLIB_INCLUDE_DIRS ${ZLIB_LIBRARIES} INTERFACE_INCLUDE_DIRECTORIES)
endif()
if(ZSTD_TYPE STREQUAL Bundled)
set(CMAKE_DISABLE_FIND_PACKAGE_ZSTD TRUE)
set(ZSTD_FOUND TRUE)
set(ZSTD_LIBRARIES zstd::zstd)
get_target_property(ZSTD_INCLUDE_DIRS ${ZSTD_LIBRARIES} INTERFACE_INCLUDE_DIRECTORIES)
endif()
# minizip-ng otherwise uses system libraries when we provide them above
set(CMAKE_DISABLE_FIND_PACKAGE_PkgConfig TRUE)
set(PKGCONFIG_FOUND FALSE)
add_subdirectory(minizip-ng)
dolphin_disable_warnings(minizip-ng)