summaryrefslogtreecommitdiff
path: root/xmake/modules/lib/detect/pkgconfig.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-05-21 00:43:46 +0800
committerruki <[email protected]>2021-05-21 00:43:46 +0800
commite65399c1d6d2a3ecd4f13f82cfe18c70e41182f3 (patch)
tree5c2d3386111336a22c4e800767106df3e7829dfa /xmake/modules/lib/detect/pkgconfig.lua
parent16a421fdcae87814b8ca5fbb53c63ddfcd688380 (diff)
improve pacman::find_package
Diffstat (limited to 'xmake/modules/lib/detect/pkgconfig.lua')
-rw-r--r--xmake/modules/lib/detect/pkgconfig.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/xmake/modules/lib/detect/pkgconfig.lua b/xmake/modules/lib/detect/pkgconfig.lua
index 9cd07a1e7..f47cd70be 100644
--- a/xmake/modules/lib/detect/pkgconfig.lua
+++ b/xmake/modules/lib/detect/pkgconfig.lua
@@ -171,6 +171,24 @@ function libinfo(name, opt)
end
end
+ -- get includedirs
+ if not result or not result.includedirs then
+ local varinfo = variables(name, "includedir", opt)
+ if varinfo and varinfo.includedir then
+ result = result or {}
+ result.includedirs = varinfo.includedir
+ end
+ end
+
+ -- get linkdirs
+ if not result or not result.linkdirs then
+ local varinfo = variables(name, "libdir", opt)
+ if varinfo and varinfo.libdir then
+ result = result or {}
+ result.linkdirs = varinfo.libdir
+ end
+ end
+
-- get version
local version = try { function() return os.iorunv(pkgconfig, {"--modversion", name}, {envs = envs}) end }
if version then