summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-01-25 00:51:41 +0800
committerruki <[email protected]>2025-01-25 00:51:41 +0800
commit4758d5fb50863ebefc7c7cdb3d3bf3670843cd82 (patch)
treeb458aa3999b78212ba5bc06bb6de15053389bcd3
parent512fe920b09fed3611a41227ba09ad92c40bc6b3 (diff)
get toolchain dirs
-rw-r--r--xmake/core/sandbox/modules/import/core/tool/toolchain.lua3
-rw-r--r--xmake/modules/lib/detect/find_tool.lua4
2 files changed, 6 insertions, 1 deletions
diff --git a/xmake/core/sandbox/modules/import/core/tool/toolchain.lua b/xmake/core/sandbox/modules/import/core/tool/toolchain.lua
index 46bd9fb1d..48867300e 100644
--- a/xmake/core/sandbox/modules/import/core/tool/toolchain.lua
+++ b/xmake/core/sandbox/modules/import/core/tool/toolchain.lua
@@ -28,7 +28,8 @@ local project = require("project/project")
local raise = require("sandbox/modules/raise")
-- inherit some builtin interfaces
-sandbox_core_tool_toolchain.apis = toolchain.apis
+sandbox_core_tool_toolchain.apis = toolchain.apis
+sandbox_core_tool_toolchain.directories = toolchain.directories
-- get all toolchains list
function sandbox_core_tool_toolchain.list()
diff --git a/xmake/modules/lib/detect/find_tool.lua b/xmake/modules/lib/detect/find_tool.lua
index e761cb9a7..8b5892483 100644
--- a/xmake/modules/lib/detect/find_tool.lua
+++ b/xmake/modules/lib/detect/find_tool.lua
@@ -23,9 +23,13 @@ import("lib.detect.find_program")
import("lib.detect.find_programver")
import("lib.detect.find_toolname")
import("core.base.semver")
+import("core.tool.toolchain")
-- find tool from modules
function _find_from_modules(name, opt)
+ -- TODO
+ print(toolchain.directories())
+
local find_tool = import("detect.tools.find_" .. name, {try = true})
if find_tool then
local program, version, toolname = find_tool(opt)