diff options
| author | ruki <[email protected]> | 2024-08-14 23:18:39 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-08-23 08:14:31 +0800 |
| commit | 39544b566c426551afe6c72e0f4c76cf5814ce67 (patch) | |
| tree | fc41344a85d99bbe8a68550d67971b520bb49702 | |
| parent | dfe41c4f149feb3fd1d9460313bd5b9dc87e0ec3 (diff) | |
use raise
| -rw-r--r-- | xmake/core/tool/toolchain.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/xmake/core/tool/toolchain.lua b/xmake/core/tool/toolchain.lua index bfd90e88c..f4055beb7 100644 --- a/xmake/core/tool/toolchain.lua +++ b/xmake/core/tool/toolchain.lua @@ -208,7 +208,9 @@ end -- get the program and name of the given tool kind function _instance:tool(toolkind) - assert(self:_is_checked()) + if not self:_is_checked() then + os.raise("toolchain(%s) has been not checked yet!", self:name()) + end -- ensure to do load for initializing toolset first -- @note we cannot call self:check() here, because it can only be called on config self:_load() @@ -807,7 +809,9 @@ function toolchain.toolconfig(toolchains, name, opt) local toolconfig = cache:get2(cachekey, name) if toolconfig == nil then for _, toolchain_inst in ipairs(toolchains) do - assert(toolchain_inst:_is_checked()) + if not toolchain_inst:_is_checked() then + os.raise("toolchain(%s) has been not checked yet!", toolchain_inst:name()) + end local values = toolchain_inst:get(name) if values then toolconfig = toolconfig or {} |
