diff options
| author | ruki <[email protected]> | 2025-09-19 00:43:10 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-09-19 00:43:10 +0800 |
| commit | 90e422afa7a4f209ccf8e45e8ec4c54a70456d90 (patch) | |
| tree | 0d7140cc3c44b68c099c7f13970e74b7125fcfab | |
| parent | 47f7c581cc8daacdd109aeed3c007d908bc9ea42 (diff) | |
improve find_tool
| -rw-r--r-- | xmake/modules/lib/detect/find_tool.lua | 11 | ||||
| -rw-r--r-- | xmake/toolchains/rust/xmake.lua | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/xmake/modules/lib/detect/find_tool.lua b/xmake/modules/lib/detect/find_tool.lua index ddf96753e..dc30b314a 100644 --- a/xmake/modules/lib/detect/find_tool.lua +++ b/xmake/modules/lib/detect/find_tool.lua @@ -33,16 +33,21 @@ function _find_from_modules(name, opt) if program then return {name = toolname or name, program = program, version = version} end + return false end + return nil end -- find tool function _find_tool(name, opt) local toolname = find_toolname(name or opt.program) if toolname then - local tool = _find_from_modules(toolname, opt) - if tool then - return tool + local result = _find_from_modules(toolname, opt) + if result then + return result + elseif result == false then + -- find_xxx.lua exists, but program not found + return end end diff --git a/xmake/toolchains/rust/xmake.lua b/xmake/toolchains/rust/xmake.lua index 76bc64923..3baa998bb 100644 --- a/xmake/toolchains/rust/xmake.lua +++ b/xmake/toolchains/rust/xmake.lua @@ -34,7 +34,7 @@ toolchain("rust") if toolchain:config("appledev") == "simulator" then opt.apple_sim = true end - + local target = target_triple(toolchain:plat(), toolchain:arch(), opt) if target then toolchain:add("rcflags", "--target=" .. target) |
