summaryrefslogtreecommitdiff
path: root/xmake/core/tool/tool.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-09-11 22:55:41 +0800
committerruki <[email protected]>2025-09-11 22:55:41 +0800
commit95892966e3e0c9a6b5c427ef52662088e7ae2def (patch)
tree4ed884aaebdce22fcc0751a8afea8c7d4f447f6f /xmake/core/tool/tool.lua
parentc54be3773f1723268a1b0abbd65f38a8ac8b95f4 (diff)
fix load tool cache
Diffstat (limited to 'xmake/core/tool/tool.lua')
-rw-r--r--xmake/core/tool/tool.lua19
1 files changed, 2 insertions, 17 deletions
diff --git a/xmake/core/tool/tool.lua b/xmake/core/tool/tool.lua
index 06a5ca3ad..c54e24c93 100644
--- a/xmake/core/tool/tool.lua
+++ b/xmake/core/tool/tool.lua
@@ -241,22 +241,8 @@ function tool.load(kind, opt)
local toolchain_info = opt.toolchain_info or {}
-- get platform and architecture
- local plat = toolchain_info.plat or config.get("plat") or os.host()
- local arch = toolchain_info.arch or config.get("arch") or os.arch()
-
- -- init cachekey
- local cachekey = kind .. (program or "") .. plat .. arch .. (opt.host and "host" or "")
- if toolchain_info and toolchain_info.cachekey then
- -- it maybe contains target key
- -- @see https://github.com/xmake-io/xmake/issues/6672
- cachekey = cachekey .. toolchain_info.cachekey
- end
-
- -- get it directly from cache dirst
- tool._TOOLS = tool._TOOLS or {}
- if tool._TOOLS[cachekey] then
- return tool._TOOLS[cachekey]
- end
+ local plat = toolchain_info.plat or config.plat() or os.host()
+ local arch = toolchain_info.arch or config.arch() or os.arch()
-- contain toolname? parse it, e.g. '[email protected]'
if program then
@@ -310,7 +296,6 @@ function tool.load(kind, opt)
if not instance then
return nil, errors
end
- tool._TOOLS[cachekey] = instance
return instance
end