-
-
Notifications
You must be signed in to change notification settings - Fork 816
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
pkg-config libraries without include directories or files to link to are not discovered #3777
Comments
? please provide your error logs with
and rename CLI11 to |
Then the failure is expected. The project is called
And No project is necessary to see the issue and I've explained why (empty
With a "project":
Useless logs are:
|
Actually, updating |
Because you used an uppercase package name, it does not exist in the xmake-repo repository. Only the lowercase cli11
Because you used an uppercase package name, it does not exist in the xmake-repo repository. Only the lowercase cli11 |
This is why package with no --cflags or --libs output is considered as not present. I tried changing that line, got find_package working, but not add_requires() . Apparently some other place needs modification as well.
|
Or maybe |
? I don't know what you mean. If there is no output from pkg-config, xmake cannot find the package. About, For CLI11, you just need to open pr to improve |
My point is that it should. Determining presence of a package based solely on the output of
Given that |
I haven't come across any available packages without any pkg-config output yet and can't test to verify it for now.
It works for me.
|
I tried installing CLI11 v2.3.2 with
I think if you install CLI11 into With CLI11 in |
please see the previous reply.
|
I'm asking about whether |
it can find system library by default. but you should pass lower case package name and improve package("cli11") -- lower case name
add_extsources("pkgconfig::CLI11") --- real name (upper case) or package("cli11")
on_fetch(function (package, opt)
if opt.system then
return package:find_package("pkgconfig:CLI11") -- upper case name
end
end) xmake.lua add_requires("cli11") --- lower case name please do not use upper case name.
|
So you need open a pr to improve and fix this package. |
from my understanding, The cli11 package should be improved, but I don't understand why uppercases names are an issue here, maybe xmake makes the name lowercase before searching the package using pkgconfig? |
Because xmake packages are not considered to support uppercase package names, users passing uppercase names to
if you pass other lower case name, even if it is not in the package, just the system library, it is still well supported.
There can be a lot of problems due to differences in case file systems on different systems, so please use lower case package names. xmake will not bother to handle any upper case package names very well either. |
Ok now I understand the behavior of xmake. Maybe xmake shouldn't lowercase the name of packages passed to add_requires?
(cli11 is just an example here, I also think the package should be improved and used instead). |
No, the user should always pass the lowercase package name to add_requires. However, the cli11 package should be improved by adding |
The only thing that should be improved is that if the user passes in an upper case package name, there should be a more friendly error message to indicate how the user should go about improving the package name. |
I understand your point of view, however since |
add_extsources and on_fetch are required and the most reliable, relying on package names to find them is unreliable, even if upper case is supported. Also, xmake package names are not necessarily related to the names of third-party repositories, they should not be coupled with each other. |
In addition, the package names of different third-party repositories cannot be completely consistent, and it is impossible to use a fixed package name to be compatible with all other repository packages and system package names. |
fair enough. I made a pull request to improve cli11: xmake-io/xmake-repo#2131 |
I thought However... If CLI11 is installed to
OK, this inconsistent behaviour is quite confusing because something might work until a corresponding package is added to |
I have improved it. #3797
please update repository.
|
improve to find package from pkg-config #3777
|
Xmake Version
v2.7.9+20230515
Operating System Version and Architecture
Slackware Linux 15.0 x86_64
pkg-config: v0.29.2
Describe Bug
Header-only libraries have empty output from
pkg-config --ldflags
andpkg-config --cflags
which seems to makeadd_requires("CLI11")
fail.Expected Behavior
add_requires()
should consider any library for whichpkg-config --exists
succeeds as present even if it doesn't need any additional compiler/linker flags.Project Configuration
No response
Additional Information and Error Logs
You can test with https://github.com/CLIUtils/CLI11 which isn't found by
add_requires()
despite being installed.The text was updated successfully, but these errors were encountered: