diff options
| author | ruki <[email protected]> | 2019-08-11 23:06:23 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-08-11 23:06:23 +0800 |
| commit | 68afe67e72fd5a94fb4fca8059952661833182db (patch) | |
| tree | a11f556ec0e9bcb1ec89ba0bedd0fb62e70f867a /xmake/modules/package | |
| parent | 7204438408a9cd31209af408d911ea45cdcb080e (diff) | |
improve find_package
Diffstat (limited to 'xmake/modules/package')
| -rw-r--r-- | xmake/modules/package/manager/brew/find_package.lua | 7 | ||||
| -rw-r--r-- | xmake/modules/package/manager/system/find_package.lua | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/xmake/modules/package/manager/brew/find_package.lua b/xmake/modules/package/manager/brew/find_package.lua index 0a2648eb7..3b039b1af 100644 --- a/xmake/modules/package/manager/brew/find_package.lua +++ b/xmake/modules/package/manager/brew/find_package.lua @@ -53,10 +53,11 @@ function main(name, opt) result = find_package("pkg_config::" .. pcname, opt) if not result then -- attempt to get includedir variable from pkg-config/xx.pc - local pkginfo = pkg_config.info(pcname, table.join(opt, {variables = "includedir"})) - if pkginfo.includedir then + local varinfo = pkg_config.variables(pcname, "includedir", opt) + if varinfo.includedir then result = result or {} - result.includedirs = pkginfo.includedir + result.version = pkg_config.version(pcname, opt) + result.includedirs = varinfo.includedir end end end diff --git a/xmake/modules/package/manager/system/find_package.lua b/xmake/modules/package/manager/system/find_package.lua index 5d07e1e8c..df2e812a0 100644 --- a/xmake/modules/package/manager/system/find_package.lua +++ b/xmake/modules/package/manager/system/find_package.lua @@ -68,7 +68,7 @@ function main(name, opt) local version = nil local links = table.wrap(opt.links) if #links == 0 then - pkginfo = pkg_config.info(name) + pkginfo = pkg_config.libinfo(name) if pkginfo then links = table.wrap(pkginfo.links) version = pkginfo.version |
