diff options
| author | ruki <[email protected]> | 2025-04-12 23:12:45 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-04-12 23:13:05 +0800 |
| commit | 62251f56eb7700129cf61994c4db0f4ef25df649 (patch) | |
| tree | c6be1161e9fac71cee9215e0e47dbcb6dc638d93 /xmake/core/tool/tool.lua | |
| parent | 7cfbacd71f14c897e2749c0b931f9ff48a768744 (diff) | |
fix import toolchain modules #6317
Diffstat (limited to 'xmake/core/tool/tool.lua')
| -rw-r--r-- | xmake/core/tool/tool.lua | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/xmake/core/tool/tool.lua b/xmake/core/tool/tool.lua index 9022880a4..468b22579 100644 --- a/xmake/core/tool/tool.lua +++ b/xmake/core/tool/tool.lua @@ -40,14 +40,12 @@ local import = require("sandbox/modules/import") function _instance.new(kind, name, program, plat, arch, toolchain_inst) -- import "core.tools.xxx" - local toolclass = nil - if os.isfile(path.join(os.programdir(), "modules", "core", "tools", name .. ".lua")) then - toolclass = import("core.tools." .. name, {nocache = true}) -- @note we need to create a tool instance with unique toolclass context (_g) - end + -- @note we need to create a tool instance with unique toolclass context (_g) + local toolclass = import("core.tools." .. name, {try = true, nocache = true}) -- not found? if not toolclass then - return nil, string.format("cannot import \"core.tool.%s\" module!", name) + return nil, string.format("cannot import \"core.tools.%s\" module!", name) end -- new an instance |
