summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-02-10 00:53:14 +0800
committerruki <[email protected]>2022-02-10 00:53:14 +0800
commit266c575bbcb9a678188d83678baebc682e871502 (patch)
treedc9f748d573357ee9f5d6aba08f3046cfaca4ca6
parent039b8b2b3dd2594c2149da5c5ccb28747de782eb (diff)
load toolchain from file
-rw-r--r--xmake/core/tool/toolchain.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/xmake/core/tool/toolchain.lua b/xmake/core/tool/toolchain.lua
index 292e940be..848668d8a 100644
--- a/xmake/core/tool/toolchain.lua
+++ b/xmake/core/tool/toolchain.lua
@@ -301,7 +301,7 @@ end
-- save toolchain to file
function _instance:savefile(filepath)
- return io.save(filepath, {name = self:name(), info = self:info():info(), configs = self._CONFIGS})
+ return io.save(filepath, {name = self:name(), info = self:info():info(), cachekey = self:cachekey(), configs = self._CONFIGS})
end
-- on check (builtin)
@@ -656,10 +656,14 @@ function toolchain.load_fromfile(filepath, opt)
if not fileinfo.name or not fileinfo.info then
return nil, string.format("%s is invalid toolchain info file!", filepath)
end
- opt = opt or {}
+ opt = table.join(opt or {}, fileinfo.configs)
+ opt.cachekey = fileinfo.cachekey
local scope_opt = {interpreter = toolchain._interpreter(), deduplicate = true, enable_filter = true}
local info = scopeinfo.new("toolchain", fileinfo.info, scope_opt)
- return toolchain.load_withinfo(fileinfo.name, info, table.join(opt, fileinfo.configs))
+ local instance = toolchain.load_withinfo(fileinfo.name, info, opt)
+ -- we need skip check
+ instance._CHECKED = true
+ return instance
end