summaryrefslogtreecommitdiff
path: root/xmake/core/tool/toolchain.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-04-24 00:38:26 +0800
committerruki <[email protected]>2021-04-24 00:38:26 +0800
commitffa126129bc10f4ab152d1ade3f8130367e400a9 (patch)
treed8a2ebc84bdbd8ee8987850625457f35b54219f6 /xmake/core/tool/toolchain.lua
parentd9387d934e1a82858434439dee22823f27efe497 (diff)
improve set_toolset
Diffstat (limited to 'xmake/core/tool/toolchain.lua')
-rw-r--r--xmake/core/tool/toolchain.lua16
1 files changed, 13 insertions, 3 deletions
diff --git a/xmake/core/tool/toolchain.lua b/xmake/core/tool/toolchain.lua
index ac0363d3d..868d05746 100644
--- a/xmake/core/tool/toolchain.lua
+++ b/xmake/core/tool/toolchain.lua
@@ -406,12 +406,22 @@ function _instance:_checktool(toolkind, toolpath)
end
end
- -- find tool program
+ -- contain toolname? parse it, e.g. '[email protected]'
+ -- https://github.com/xmake-io/xmake/issues/1361
local program, toolname
- local tool = find_tool(toolpath, {cachekey = cachekey, program = toolpath, paths = self:bindir(), envs = self:get("runenvs")})
+ if toolpath then
+ local pos = toolpath:find('@', 1, true)
+ if pos then
+ toolname = toolpath:sub(1, pos - 1)
+ program = toolpath:sub(pos + 1)
+ end
+ end
+
+ -- find tool program
+ local tool = find_tool(toolpath, {cachekey = cachekey, program = program or toolpath, paths = self:bindir(), envs = self:get("runenvs")})
if tool then
program = tool.program
- toolname = tool.name
+ toolname = toolname or tool.name
end
-- get tool description from the tool kind