Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

winbuild: fail to build WITH_ZLIB=static #11521

Closed
wants to merge 1 commit into from

Conversation

moehuster
Copy link

No description provided.

@github-actions github-actions bot added build Windows Windows-specific labels Jul 26, 2023
@@ -262,8 +262,8 @@ ZLIB_LIBS = zlib.lib
USE_ZLIB = true
ZLIB = dll
!ELSEIF "$(WITH_ZLIB)"=="static"
!IF EXISTS("$(ZLIB_LIB_DIR)\zlibstat.lib")
ZLIB_LIBS = zlibstat.lib
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a typo, the visual studio zlibstat project's output is zlibstat.lib. Where are you getting zlibstatic.lib from? Are you using a different build method?

@moehuster
Copy link
Author

moehuster commented Jul 28, 2023

I use cmake generate visual studio project. It's zlib's bug, may be.
add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
https://github.com/madler/zlib/blob/master/CMakeLists.txt#L151

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarcelRaad can you confirm- unlike zlib's contrib VS project files, something like zlibstatic.lib (cmake outfile) doesn't need /DZLIB_WINAPI ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I can confirm that ZLIB_WINAPI is only defined by the VS projects by default.

@jay jay closed this in 7bfb10c Jul 29, 2023
@jay
Copy link
Member

jay commented Jul 29, 2023

Thanks

ptitSeb pushed a commit to wasix-org/curl that referenced this pull request Sep 25, 2023
- 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 curl#11521
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants