Skip to content

Conversation

@ClausKlein
Copy link

add option to build either shared or static lib

fix build problems on msys2 and conan

see bincrafters/community#205
and https://github.com/conan-community/conan-zlib/issues/32

@mattparks
Copy link

I had to make this minor change to build on Android: spauldingdevice@130e7b0

Before this change I would get the following compiler error: error: unknown type name 'z_size_t'

@puneetmatharu
Copy link

Are there any plans to merge this PR? I would certainly find it helpful so that I can fetch zlib via FetchContent.

@Neustradamus
Copy link

@puneetmatharu
Copy link

True. I thought I'd prod just in case it might lead to these changes pushed through.

It's not a problem anymore though, I've made my own fork with the changes I require. Thanks!

@Neustradamus Neustradamus mentioned this pull request Oct 26, 2022
@Neustradamus Neustradamus mentioned this pull request Jul 30, 2023
@ClausKlein ClausKlein force-pushed the feature/improveCmake branch 2 times, most recently from 977c9c1 to a85ce74 Compare July 31, 2023 06:42
@madler madler changed the base branch from master to develop August 19, 2023 18:14
@madler
Copy link
Owner

madler commented Aug 19, 2023

These commits are out of date.

vszakats added a commit to curl/curl-for-win that referenced this pull request Aug 19, 2023
It's ineffective to actually disable building the shared lib as of
zlib v1.3. Enable it anyway in the hope that one day it might be fixed,
e.g. by merging this PR opened in 2018:

madler/zlib#347

This would allow an even less obtrusive workaround for the RC
compilation bug, by allowing to disable building the DLL and thus not
hitting that bug in the first place. All this via CMake and without the
manual, GNU Make-level hackery and manual install phase.
@Neustradamus
Copy link

@madler: @ClausKlein has done an update since 2018:

@madler
Copy link
Owner

madler commented Aug 20, 2023

@Neustradamus This is #347.

@Neustradamus
Copy link

@madler: Yes it has been recently updated

@madler
Copy link
Owner

madler commented Aug 20, 2023

@Neustradamus My comment was hours ago, and so was referring to the most recent updates.

@Neustradamus
Copy link

@madler: Sorry!

@ClausKlein: Can you look?

@ClausKlein ClausKlein force-pushed the feature/improveCmake branch from 2cb00f8 to b67c694 Compare August 20, 2023 06:47
@ClausKlein
Copy link
Author

ClausKlein commented Aug 20, 2023

These commits are out of date.

Sorry, I have rebased with current develop now.

ClausKlein and others added 4 commits August 20, 2023 12:20
- remove unneeded asm obtions
  There are not asm files in source tree!

- add export statement for cmake config

- install zlib namespace zlib::zlib to support FetchContent cmake module

- build tests and examples under clear condions
@ClausKlein ClausKlein force-pushed the feature/improveCmake branch from 8eab66f to b9a11c5 Compare August 20, 2023 10:24
@Neustradamus
Copy link

@ClausKlein: Thanks :)

@madler: It is good?

@Neustradamus
Copy link

@madler: Can you look this updated PR?

@tritao
Copy link

tritao commented Aug 12, 2024

Can this be merged?

Copy link

@craigscott-crascit craigscott-crascit left a comment

Choose a reason for hiding this comment

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

Leaving a few comments to clean up, maybe that will encourage getting this PR over the line.

README Outdated
well, "make install" should work for most flavors of Unix. For Windows, use
one of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use
make_vms.com.
To compile all files and run the test program, follow this instructions:

Choose a reason for hiding this comment

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

Your example commands also install zlib.

Copy link
Author

@ClausKlein ClausKlein Aug 22, 2024

Choose a reason for hiding this comment

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

but not to the destination that I have expected:

bash-5.2$ cmake --install build --prefix /tmp/zlib
-- Install configuration: "Release"
-- Installing: /usr/local/lib/cmake/zlib/zlibConfigVersion.cmake
-- Up-to-date: /usr/local/lib/libz.a
-- Installing: /usr/local/lib/cmake/zlib/zlibConfig.cmake
-- Installing: /usr/local/lib/cmake/zlib/zlibConfig-release.cmake
-- Up-to-date: /usr/local/include/zconf.h
-- Up-to-date: /usr/local/include/zlib.h
-- Up-to-date: /usr/local/share/man/man3/zlib.3
-- Up-to-date: /usr/local/share/pkgconfig/zlib.pc
bash-5.2$ gvim /usr/local/lib/cmake/zlib/*.cmake

Co-authored-by: Craig Scott <craig.scott@crascit.com>
Use gcc on OSX ci

Use GNUInstallDirs to be more flexible
@ClausKlein ClausKlein force-pushed the feature/improveCmake branch from cf12420 to c20611e Compare August 22, 2024 12:28
@ClausKlein
Copy link
Author

ClausKlein commented Aug 22, 2024

@craigscott-crascit replaced with #1004

@ClausKlein ClausKlein closed this Aug 22, 2024
install(EXPORT ${PROJECT_NAME}Config
NAMESPACE zlib:: DESTINATION "${INSTALL_LIB_DIR}/cmake/${PROJECT_NAME}"
install(EXPORT zlibConfig
NAMESPACE zlib:: DESTINATION "${ZLIB_INSTALL_CMAKEDIR}"
Copy link
Author

Choose a reason for hiding this comment

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

@craigscott-crascit Note: this namespace is exported here, not ZLIB::ZLIB?

@ClausKlein ClausKlein deleted the feature/improveCmake branch December 17, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants