]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
winbuild: improve check for static zlib
authorwangzhikun <wangzhikun@theseustech.cn>
Fri, 28 Jul 2023 03:00:06 +0000 (11:00 +0800)
committerJay Satiro <raysatiro@yahoo.com>
Sat, 29 Jul 2023 19:05:10 +0000 (15:05 -0400)
- 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

index 5cf65dcd7fa4108460df68018fcee56212da4b1a..035ed125c54e61020df3af7e01e21bf4071d99af 100644 (file)
@@ -265,6 +265,8 @@ ZLIB        = dll
 !IF EXISTS("$(ZLIB_LIB_DIR)\zlibstat.lib")\r
 ZLIB_LIBS   = zlibstat.lib\r
 ADDITIONAL_ZLIB_CFLAGS = /DZLIB_WINAPI\r
+!ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zlibstatic.lib")\r
+ZLIB_LIBS   = zlibstatic.lib\r
 !ELSEIF EXISTS("$(ZLIB_LIB_DIR)\zlib.lib")\r
 ZLIB_LIBS   = zlib.lib\r
 !ELSE\r