Skip to content

Commit 66d3b24

Browse files
committed
(toolchain) make toolchain._memcache public
1 parent 3df2d21 commit 66d3b24

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

xmake/core/sandbox/modules/import/core/tool/toolchain.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ local raise = require("sandbox/modules/raise")
3131
sandbox_core_tool_toolchain.apis = toolchain.apis
3232
sandbox_core_tool_toolchain.directories = toolchain.directories
3333
sandbox_core_tool_toolchain.save = toolchain.save
34+
sandbox_core_tool_toolchain.memcache = toolchain.memcache
3435

3536
-- get all toolchains list
3637
function sandbox_core_tool_toolchain.list()

xmake/core/tool/toolchain.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ function _instance:_checktool(toolkind, toolpath)
483483

484484
-- get result from cache first
485485
local cachekey = self:cachekey() .. "_checktool" .. toolkind
486-
local result = toolchain._memcache():get3(cachekey, toolkind, toolpath)
486+
local result = toolchain.memcache():get3(cachekey, toolkind, toolpath)
487487
if result then
488488
return result[1], result[2]
489489
end
@@ -552,12 +552,12 @@ function _instance:_checktool(toolkind, toolpath)
552552
utils.cprint("${dim}checking for %s (%s: ${bright}%s${clear}) ... ${color.nothing}${text.nothing}", description, toolkind, toolpath)
553553
end
554554
end
555-
toolchain._memcache():set3(cachekey, toolkind, toolpath, {program, toolname})
555+
toolchain.memcache():set3(cachekey, toolkind, toolpath, {program, toolname})
556556
return program, toolname
557557
end
558558

559559
-- get memcache
560-
function toolchain._memcache()
560+
function toolchain.memcache()
561561
return memcache.cache("core.tool.toolchain")
562562
end
563563

@@ -722,7 +722,7 @@ function toolchain.load(name, opt)
722722
configs.arch = opt.arch or config.get("arch") or os.arch()
723723

724724
-- get cache
725-
local cache = toolchain._memcache()
725+
local cache = toolchain.memcache()
726726
local cachekey = toolchain._cachekey(name, configs)
727727

728728
-- get it directly from cache dirst
@@ -787,7 +787,7 @@ function toolchain.load_withinfo(name, info, opt)
787787
configs.arch = opt.arch or config.get("arch") or os.arch()
788788

789789
-- get cache key
790-
local cache = toolchain._memcache()
790+
local cache = toolchain.memcache()
791791
local cachekey = toolchain._cachekey(name, configs)
792792

793793
-- get it directly from cache dirst
@@ -899,7 +899,7 @@ function toolchain.toolconfig(toolchains, name, opt)
899899
local arch = opt.arch or config.get("arch") or os.arch()
900900

901901
-- get cache and cachekey
902-
local cache = toolchain._memcache()
902+
local cache = toolchain.memcache()
903903
local cachekey = "toolconfig_" .. (opt.cachekey or "") .. "_" .. plat .. "_" .. arch
904904

905905
-- get configuration

0 commit comments

Comments
 (0)