From 7bfb10c1803deb0e6dc1147bdd594129ea480a91 Mon Sep 17 00:00:00 2001 From: wangzhikun Date: Fri, 28 Jul 2023 11:00:06 +0800 Subject: [PATCH] winbuild: improve check for static zlib - Check for zlib static library name zlibstatic.lib. zlib's static library has a different name depending on how it was built. zlibstatic.lib is output by cmake. zlibstat.lib is output by their pre-generated Visual Studio project files (in the contrib directory) and defines ZLIB_WINAPI (ie it's meant to use stdcall instead of cdecl if you end up exporting the zlib functions). Prior to this change the makefile only checked for the latter. Closes https://github.com/curl/curl/pull/11521 --- winbuild/MakefileBuild.vc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/winbuild/MakefileBuild.vc b/winbuild/MakefileBuild.vc index 5cf65dcd7f..035ed125c5 100644 --- a/winbuild/MakefileBuild.vc +++ b/winbuild/MakefileBuild.vc @@ -265,6 +265,8 @@ ZLIB = dll !IF EXISTS("$(ZLIB_LIB_DIR)\zlibstat.lib") ZLIB_LIBS = zlibstat.lib ADDITIONAL_ZLIB_CFLAGS = /DZLIB_WINAPI +!ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zlibstatic.lib") +ZLIB_LIBS = zlibstatic.lib !ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zlib.lib") ZLIB_LIBS = zlib.lib !ELSE -- 2.47.3