summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Vandaƫle <joshua@vandaele.software>2025-12-24 04:59:08 +0100
committerOatmealDome <julian@oatmealdome.me>2026-03-17 17:29:09 -0400
commitb66d9b707f1ef7b054f1c5e46e9446b4cce3d472 (patch)
tree4a3edc873b8f6df26a9b02384df9981e7082a6d0
parent65d3d76cfef8a3503cf84aff76eccfb76126e290 (diff)
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.
-rw-r--r--CMakeLists.txt16
-rw-r--r--Externals/minizip-ng/CMakeLists.txt35
2 files changed, 42 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0ffe18889b..719a50adc8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -658,6 +658,13 @@ if(NOT (WIN32 AND _M_ARM_64))
add_definitions(-DHAS_OPENGL)
endif()
+if(NOT WIN32)
+ if(ANDROID)
+ set(USE_SYSTEM_Iconv OFF)
+ endif()
+ dolphin_find_optional_system_library(Iconv Externals/libiconv 1.14)
+endif()
+
dolphin_find_optional_system_library(pugixml Externals/pugixml)
dolphin_find_optional_system_library_pkgconfig(ENET libenet>=1.3.18 enet::enet Externals/enet)
@@ -718,15 +725,6 @@ dolphin_find_optional_system_library(MBEDTLS Externals/mbedtls 2.28)
dolphin_find_optional_system_library(CURL Externals/curl)
-if(NOT WIN32)
- if(NOT ANDROID)
- dolphin_find_optional_system_library(Iconv Externals/libiconv 1.14)
- else()
- message(STATUS "Using static iconv from Externals")
- add_subdirectory(Externals/libiconv EXCLUDE_FROM_ALL)
- endif()
-endif()
-
if(NOT ANDROID)
dolphin_find_optional_system_library(HIDAPI Externals/hidapi)
endif()
diff --git a/Externals/minizip-ng/CMakeLists.txt b/Externals/minizip-ng/CMakeLists.txt
index adf2611841..9e7d41cbbf 100644
--- a/Externals/minizip-ng/CMakeLists.txt
+++ b/Externals/minizip-ng/CMakeLists.txt
@@ -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)