summaryrefslogtreecommitdiff
path: root/xmake/modules/package/manager/brew/find_package.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/package/manager/brew/find_package.lua')
-rw-r--r--xmake/modules/package/manager/brew/find_package.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/xmake/modules/package/manager/brew/find_package.lua b/xmake/modules/package/manager/brew/find_package.lua
index 5eb2beba3..0a2648eb7 100644
--- a/xmake/modules/package/manager/brew/find_package.lua
+++ b/xmake/modules/package/manager/brew/find_package.lua
@@ -21,6 +21,7 @@
-- imports
import("lib.detect.find_tool")
import("lib.detect.find_file")
+import("lib.detect.pkg_config")
import("package.manager.find_package")
-- find package from the brew package manager
@@ -50,6 +51,14 @@ function main(name, opt)
if pcfile then
opt.configdirs = path.directory(pcfile)
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
+ result = result or {}
+ result.includedirs = pkginfo.includedir
+ end
+ end
end
-- find package from xxx/lib, xxx/include