You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by sz...@apache.org on 2026/06/15 10:26:48 UTC
(nifi-minifi-cpp) 01/04: MINIFICPP-2848 Fix zlib build in debug mode on Windows
This is an automated email from the ASF dual-hosted git repository.
szaszm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
commit 04aaea89f33b73bbf6cb7c55a36948aa76047c84
Author: Gabor Gyimesi <ga...@gmail.com>
AuthorDate: Mon Jun 15 12:25:10 2026 +0200
MINIFICPP-2848 Fix zlib build in debug mode on Windows
Closes #2200
Signed-off-by: Marton Szasz <sz...@apache.org>
---
cmake/ZLIB.cmake | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/cmake/ZLIB.cmake b/cmake/ZLIB.cmake
index 6f32ff28c..9ef4bf324 100644
--- a/cmake/ZLIB.cmake
+++ b/cmake/ZLIB.cmake
@@ -29,6 +29,12 @@ FetchContent_Declare(
FetchContent_MakeAvailable(zlib)
+if(WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug")
+ set(_zlib_debug_suffix "d")
+else()
+ set(_zlib_debug_suffix "")
+endif()
+
if(WIN32)
set(_zlib_static_suffix "s")
else()
@@ -37,7 +43,7 @@ endif()
set(ZLIB_FOUND "YES" CACHE STRING "" FORCE)
set(ZLIB_INCLUDE_DIRS "${zlib_SOURCE_DIR}" CACHE STRING "" FORCE)
-set(ZLIB_LIBRARY "${zlib_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}z${_zlib_static_suffix}${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE STRING "" FORCE)
+set(ZLIB_LIBRARY "${zlib_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}z${_zlib_static_suffix}${_zlib_debug_suffix}${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE STRING "" FORCE)
set(ZLIB_LIBRARIES "${ZLIB_LIBRARY}" CACHE STRING "" FORCE)
# Set exported variables for FindPackage.cmake