From: wangzhikun Date: Fri, 28 Jul 2023 03:00:06 +0000 (+0800) Subject: winbuild: improve check for static zlib X-Git-Tag: curl-8_3_0~281 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7bfb10c1803deb0e6dc1147bdd594129ea480a91;p=thirdparty%2Fcurl.git 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 --- 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