summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/core/sandbox/modules/import/core/tool/toolchain.lua1
-rw-r--r--xmake/core/tool/toolchain.lua8
2 files changed, 5 insertions, 4 deletions
diff --git a/xmake/core/sandbox/modules/import/core/tool/toolchain.lua b/xmake/core/sandbox/modules/import/core/tool/toolchain.lua
index 922074cac..4282acd0f 100644
--- a/xmake/core/sandbox/modules/import/core/tool/toolchain.lua
+++ b/xmake/core/sandbox/modules/import/core/tool/toolchain.lua
@@ -31,6 +31,7 @@ local raise = require("sandbox/modules/raise")
sandbox_core_tool_toolchain.apis = toolchain.apis
sandbox_core_tool_toolchain.directories = toolchain.directories
sandbox_core_tool_toolchain.save = toolchain.save
+sandbox_core_tool_toolchain.memcache = toolchain.memcache
-- get all toolchains list
function sandbox_core_tool_toolchain.list()
diff --git a/xmake/core/tool/toolchain.lua b/xmake/core/tool/toolchain.lua
index 1da1634db..4fff15683 100644
--- a/xmake/core/tool/toolchain.lua
+++ b/xmake/core/tool/toolchain.lua
@@ -567,7 +567,7 @@ function _instance:_checktool(toolkind, toolpath)
end
-- get memcache
-function toolchain._memcache()
+function toolchain.memcache()
return memcache.cache("core.tool.toolchain")
end
@@ -732,7 +732,7 @@ function toolchain.load(name, opt)
configs.arch = opt.arch or config.get("arch") or os.arch()
-- get cache
- local cache = toolchain._memcache()
+ local cache = toolchain.memcache()
local cachekey = toolchain._cachekey(name, configs)
-- get it directly from cache dirst
@@ -797,7 +797,7 @@ function toolchain.load_withinfo(name, info, opt)
configs.arch = opt.arch or config.get("arch") or os.arch()
-- get cache key
- local cache = toolchain._memcache()
+ local cache = toolchain.memcache()
local cachekey = toolchain._cachekey(name, configs)
-- get it directly from cache dirst
@@ -909,7 +909,7 @@ function toolchain.toolconfig(toolchains, name, opt)
local arch = opt.arch or config.get("arch") or os.arch()
-- get cache and cachekey
- local cache = toolchain._memcache()
+ local cache = toolchain.memcache()
local cachekey = "toolconfig_" .. (opt.cachekey or "") .. "_" .. plat .. "_" .. arch
-- get configuration