summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-12-29 22:35:22 +0800
committerruki <[email protected]>2021-12-29 22:35:22 +0800
commit66c17b716042be1c7d21c407a321cb4894924da5 (patch)
tree354f1b365c06e60c2c5f944c5ac8a06eef32ee4d
parent8f8ab64567127d96af6bc7321633d157916e1c97 (diff)
improve tools/meson
-rw-r--r--xmake/modules/package/tools/meson.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/meson.lua b/xmake/modules/package/tools/meson.lua
index e4fa993ff..b7a396a02 100644
--- a/xmake/modules/package/tools/meson.lua
+++ b/xmake/modules/package/tools/meson.lua
@@ -25,6 +25,7 @@ import("core.tool.toolchain")
import("core.tool.linker")
import("core.tool.compiler")
import("package.tools.ninja")
+import("lib.detect.find_tool")
-- get build directory
function _get_buildir(package, opt)
@@ -153,6 +154,10 @@ function buildenvs(package)
envs.SHFLAGS = table.concat(shflags, ' ')
if package:is_plat("windows") then
envs = os.joinenvs(envs, _get_msvc_runenvs(package))
+ local pkgconf = find_tool("pkgconf")
+ if pkgconf then
+ envs.PKG_CONFIG = pkgconf.program
+ end
end
else
local cflags = table.join(table.wrap(package:build_getenv("cxflags")), package:build_getenv("cflags"))