Same CMake Build zlib

I wanted to build zlib-ng within the same project, but I don't want to make a build-install step for that. The fetch function also did not work. So here I propose to use an existing zlib target, found in the current cmake project
This commit is contained in:
tanolino 2025-03-15 20:58:52 +01:00 committed by GitHub
parent e6eeb4ea52
commit 877e092d81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -187,6 +187,10 @@ if(MZ_ZLIB)
set(PC_PRIVATE_DEPS "zlib-ng")
set(ZLIB_COMPAT OFF)
elseif(TARGET zlib)
message(STATUS "Using TARGET zlib")
set(PC_PRIVATE_DEPS "zlib")
list(APPEND MINIZIP_LIB zlib)
elseif(ZLIB_FOUND AND NOT MZ_FORCE_FETCH_LIBS)
message(STATUS "Using ZLIB ${ZLIB_VERSION}")