summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-10-01 00:43:33 +0800
committerruki <[email protected]>2024-10-01 00:43:33 +0800
commit6e749255a49166aadddf4e7784d82105970e04e5 (patch)
tree732a01104baf6c1a0b3b0b53fd289ac61f39fb11
parent2ec672aef4e271c6d08e889576809cd6443934b3 (diff)
fix check toolchain
-rw-r--r--xmake/core/tool/toolchain.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/xmake/core/tool/toolchain.lua b/xmake/core/tool/toolchain.lua
index a8c4e514a..d5716ce2e 100644
--- a/xmake/core/tool/toolchain.lua
+++ b/xmake/core/tool/toolchain.lua
@@ -273,23 +273,25 @@ end
-- do check, we only check it once for all architectures
function _instance:check()
- local checkok = true
- local checked = self:_is_checked()
- if not checked then
+ local checked = self:config("__checked")
+ if checked == nil then
local on_check = self:_on_check()
if on_check then
local ok, results_or_errors = sandbox.load(on_check, self)
if ok then
- checkok = results_or_errors
+ checked = results_or_errors
else
os.raise(results_or_errors)
end
+ else
+ checked = true
end
-- we need to persist this state
- self:config_set("__checked", true)
+ checked = checked or false
+ self:config_set("__checked", checked)
self:configs_save()
end
- return checkok
+ return checked
end
-- do load manually, it will call on_load()
@@ -386,7 +388,7 @@ end
-- is checked?
function _instance:_is_checked()
- return self:config("__checked") == true or self:_on_check() == nil
+ return self:config("__checked") ~= nil or self:_on_check() == nil
end
-- get the tool description from the tool kind