-
Notifications
You must be signed in to change notification settings - Fork 629
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
Use Zlib as a package #475
Conversation
In future, I'd suggest reading version information from |
@ctruta can you review and merge this PR? |
Hello and thank you for your contribution. There are a couple of fixes that I want to get out the door right now, with libpng-1.6.40, but I will take a closer look at this PR for version 1.6.41. |
43b588d
to
05703a0
Compare
@ctruta in CMake 3.27 |
Just to comment I have this commit and it resolves my issues using libpng as an imported project using Cmake Fetchpackage. |
@ctruta it has been a while since 1.6.40 release. Can you merge this PR now? |
I'm also waiting for this. We needed to patch the latest release because our CMake 3.27 had some issues with it. This patch solves them. Would be great to see it in 1.6.41! |
800ee3d
to
24acfe9
Compare
@ctruta the PR was rebased and ready for merge |
@jbowler can you review this? |
@ctruta what else is needed to have this PR merged? |
Well, you asked me to review it and I can't do that but I can test it. It doesn't work. I first verified that a cmake build with the current libpng16 HEAD works; it all worked just fine in so far as it goes (it doesn't seem to run any tests, but I just typed "make"). With the PR (gh pr pull 475) "cmake" works too, it finds /usr/lib64/libz.so just like it does without the PR but then the build fails at the link of pngvalid. Curiously pngtest does link, so it is finding zlib somewhere, however pngvalid just fails with an undefined reference to This is a standard system; Gentoo (admittedly a ~dev build) with zlib 1.3. It works without the change it does not work with it. There's absolutely nothing weird about the environment I used; it's just a git clone. A clue might be that after the report about the missing symbol there's another one. Here's all the error output:
|
It's because pngvalid calls zlib::crc32 directly. It's not the only test program fails to build. You should test this stuff with an up-to-date GCC as well as clang. Other programs are failing because -lm isn't there; it looks like none of the external libraries are being added to the command line. |
Thank you for testing. I'll update my PR to fix other components |
1. automatic linking of the library and add include directory 2. properly specify include directories
24acfe9
to
db8df06
Compare
@jbowler I force-pushed the fix. CMake automatically adds |
That seems to fix it. Tested with: CC="" CFLAGS="-Wall -Wextra" cmake For gcc-11, gcc-12, gcc-13 and cmake. Also checked: configure Since that's the only thing that can break (so far as I can see) with this change (it only changes CMakeLists.txt) Still needs a review from @ctruta but it seems to me that adding -lz and (if present) -lm in all cases is required anyway to support static builds. |
Hello and thank you @theta682 for your continuing insistence and patience. I wish I could have been more involved with the PNG project in the recent past, but "life happened". In any case, as you probably noticed, I applied some (most?) of your initial changes in commit f229456, leaving out the "use zlib as a package" part. I'm glad that you and @jbowler were able to develop it further. Today I gave it another spin. It passed all of my offline and online testing, and it is now integrated. Thanks again! |
include
directoriesm
library (require system provided)