summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-10-16 23:06:47 +0800
committerruki <[email protected]>2020-10-16 23:06:47 +0800
commitd482b1f6dc82ed80161600f2697ca33183dd02a2 (patch)
tree1941aff3904de5258a6b2c4f32aa9b3106b1ae43
parentac9709a378add2e46001f1aa954f84e6a323172a (diff)
improve find_package for pkgconfig
-rw-r--r--xmake/modules/package/manager/pkg_config/find_package.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/xmake/modules/package/manager/pkg_config/find_package.lua b/xmake/modules/package/manager/pkg_config/find_package.lua
index 87ba36677..c2fc22e33 100644
--- a/xmake/modules/package/manager/pkg_config/find_package.lua
+++ b/xmake/modules/package/manager/pkg_config/find_package.lua
@@ -35,6 +35,10 @@ function main(name, opt)
-- get library info
local libinfo = pkg_config.libinfo(name, opt)
+ if not libinfo and name:startswith("lib") then
+ -- libxxx? attempt to find xxx without `lib` prefix
+ libinfo = pkg_config.libinfo(name:sub(4), opt)
+ end
if not libinfo then
return
end