diff options
| author | ruki <[email protected]> | 2024-09-30 23:06:07 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-09-30 23:06:07 +0800 |
| commit | ab08bdeeaf5a87bd6cca90037b65fa077b5b2441 (patch) | |
| tree | a28dbdaf2cb827ef7bf72fd6c85717ee5b31b23e | |
| parent | 654f149719975310ee8998e3d6c1f120ddcb8641 (diff) | |
| parent | 6e749255a49166aadddf4e7784d82105970e04e5 (diff) | |
Merge pull request #5680 from xmake-io/toolchain
fix check toolchain
| -rw-r--r-- | xmake/core/tool/toolchain.lua | 16 |
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 |
