diff options
| author | ruki <[email protected]> | 2022-09-22 23:00:47 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-09-22 23:00:47 +0800 |
| commit | 9473e491160500cda2670e5140cfd2bfe2c1adbb (patch) | |
| tree | 38122d56f3d1aefae0a763bf80ae2bdbb47c6d7a /xmake/core/tool/toolchain.lua | |
| parent | 6cd2861b8335ea0377383e778e3afd4223f1dd14 (diff) | |
improve toolchain #2853
Diffstat (limited to 'xmake/core/tool/toolchain.lua')
| -rw-r--r-- | xmake/core/tool/toolchain.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/core/tool/toolchain.lua b/xmake/core/tool/toolchain.lua index 848668d8a..94a9309e9 100644 --- a/xmake/core/tool/toolchain.lua +++ b/xmake/core/tool/toolchain.lua @@ -428,8 +428,13 @@ function _instance:_checktool(toolkind, toolpath) if toolpath then local pos = toolpath:find('@', 1, true) if pos then - toolname = toolpath:sub(1, pos - 1) - program = toolpath:sub(pos + 1) + -- we need ignore valid path with `@`, e.g. /usr/local/opt/[email protected]/bin/go + -- https://github.com/xmake-io/xmake/issues/2853 + local prefix = toolpath:sub(1, pos - 1) + if prefix and not prefix:find("[/\\]") then + toolname = prefix + program = toolpath:sub(pos + 1) + end end end |
