summaryrefslogtreecommitdiff
path: root/xmake/scripts/tools/tools.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/scripts/tools/tools.lua')
-rw-r--r--xmake/scripts/tools/tools.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/xmake/scripts/tools/tools.lua b/xmake/scripts/tools/tools.lua
index 3dafcd749..862397704 100644
--- a/xmake/scripts/tools/tools.lua
+++ b/xmake/scripts/tools/tools.lua
@@ -171,8 +171,17 @@ function tools.load(name, root)
end
-- get the given tool from the current platform
-function tools.get(name)
- return tools.load(platform.tool(name))
+function tools.get(kind)
+
+ -- get the tool name
+ local toolname = platform.tool(kind)
+ if not toolname then
+ utils.error("cannot get tool name for %s", kind)
+ return
+ end
+
+ -- load it
+ return tools.load(toolname)
end
-- probe it's absolute path if exists from the given tool name