summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/meson.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-08-19 22:27:41 +0800
committerruki <[email protected]>2024-08-19 22:27:41 +0800
commit2f80f249fa152271708ec2485efa7e216d6d7b02 (patch)
treef799347359baf18e96e1deb341661a1b99104dd0 /xmake/modules/package/tools/meson.lua
parentd342e78c2f24434935eb371d0dd5bba5410dbf3f (diff)
improve to get pkgconf for meson
Diffstat (limited to 'xmake/modules/package/tools/meson.lua')
-rw-r--r--xmake/modules/package/tools/meson.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/meson.lua b/xmake/modules/package/tools/meson.lua
index caa75c620..ddac3c5a4 100644
--- a/xmake/modules/package/tools/meson.lua
+++ b/xmake/modules/package/tools/meson.lua
@@ -50,6 +50,20 @@ end
-- get pkg-config, we need force to find it, because package install environments will be changed
function _get_pkgconfig(package)
+ -- meson need fullpath pkgconfig
+ -- @see https://github.com/xmake-io/xmake/issues/5474
+ local dep = package:dep("pkgconf") or package:dep("pkg-config")
+ if dep then
+ local suffix = dep:is_plat("windows", "mingw") and ".exe" or ""
+ local pkgconf = path.join(dep:installdir("bin"), "pkgconf" .. suffix)
+ if os.isfile(pkgconf) then
+ return pkgconf
+ end
+ local pkgconfig = path.join(dep:installdir("bin"), "pkg-config" .. suffix)
+ if os.isfile(pkgconfig) then
+ return pkgconfig
+ end
+ end
if package:is_plat("windows") then
local pkgconf = find_tool("pkgconf", {force = true})
if pkgconf then