summaryrefslogtreecommitdiff
path: root/xmake/modules/package
diff options
context:
space:
mode:
authorruki <[email protected]>2020-09-04 22:53:41 +0800
committerruki <[email protected]>2020-09-04 22:53:41 +0800
commit6d94dd1d7ae4b19977fddef3396b454235f6a6f1 (patch)
treead98079a8a3400b053451200e4aa1ae056626416 /xmake/modules/package
parent304cd31298a66501aecec161c31f5e94aa5ac142 (diff)
improve pkg_config.find_package
Diffstat (limited to 'xmake/modules/package')
-rw-r--r--xmake/modules/package/manager/pkg_config/find_package.lua20
1 files changed, 19 insertions, 1 deletions
diff --git a/xmake/modules/package/manager/pkg_config/find_package.lua b/xmake/modules/package/manager/pkg_config/find_package.lua
index b96a480ff..5ca2d5394 100644
--- a/xmake/modules/package/manager/pkg_config/find_package.lua
+++ b/xmake/modules/package/manager/pkg_config/find_package.lua
@@ -27,5 +27,23 @@ import("lib.detect.pkg_config")
-- @param opt the options, e.g. {verbose = true, version = "1.12.x")
--
function main(name, opt)
- return pkg_config.find(name, opt)
+
+ -- init options
+ opt = opt or {}
+
+ -- get library info
+ local libinfo = pkg_config.libinfo(name, opt)
+ if not libinfo then
+ return
+ end
+
+ local result = nil
+ if libinfo.links or libinfo.includedirs then
+ result = result or {}
+ result.includedirs = libinfo.includedirs
+ result.linkdirs = libinfo.linkdirs
+ result.links = libinfo.links
+ result.version = libinfo.version
+ end
+ return result
end