-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Support zstd also via pkg-config #2121
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR appears to be "obviously broken", because it is obvious that attempting to do
find_package(cpp-httplib)
doesn't include the same changes, thus, it fails.Aside: maybe about time for the cmake files to generate a pkgconfig file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just an unfortunate side-effect of having to manually handle these things in Cmake. While it's not technically unfixable, it's a bit annoying.
You'd realistically need to check if found after find_dependency calls. If not found, run the pkgconf equivalent in the correct quiet/normal mode, create the aliases, etc.
I don't think it's "obviously broken". It'd just fail to find it in the specific case where you built with a pkgconf dependency then tried to find it with find_package. Has no bearing on actually building/using the library, just with post-build cmake integration into other projects.
But I guess I can look into it..
Also, like discussed in other issues before, there's no clean way to generate pkgconfig files as it's not a cmake feature at all. It'd just end up as another file you manually manage like a
cmake.in
file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The zstd project doesn't distribute a find_package() module at all, so the default case involves building with a pkgconf dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for a .pc is much more straightforward because you already know what type of dependency to find so all you have to do is say yes or no do you embed the specific string in the requires field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eli-schwartz that may add support of usage via
pkg_check_modules(cpp-httplib)
or however it would be called, but wouldn't fixfind_package(httplib)
unless it's rewritten to use pkg-config, if I understand what you meanThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also allow usage from autoconf or meson. ;)
Meson can execute
find_package(httplib)
as a dependency finder but it is quite slow and fragile as it involves generating a dummy project which does so, and then using the cmake debug traces to determine what compile arguments were resolved byfind_package(httplib)
. Using a buildsystem-agnostic interchange format allows divorcing oneself from the unreliability of a cmake config file...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All build systems suck, it's not really worth talking about.
Even this project has like 3 I think? Cmake, Meson, and Makefile.
If you want a
.pc
file then write one, I doubt the PR would be denied.Also, as I said, Cmake doesn't make generating them any less painless then the current
cmake.in
config system. It'd have the same problems (and probably more janky).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So erm maybe if all build systems suck that's a reason to support pkg-config (which is just a standard, not a set of competing standards)???
Because, you know. Then I can find cpp-httplib and use it in my code without having to deal with buildsystem proliferation, since I'm not required to run a build system in order to find the compile flags for cpp-httplib. I can even use:
"Look ma, no build system!"