summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-09-19 00:43:10 +0800
committerruki <[email protected]>2025-09-19 00:43:10 +0800
commit90e422afa7a4f209ccf8e45e8ec4c54a70456d90 (patch)
tree0d7140cc3c44b68c099c7f13970e74b7125fcfab
parent47f7c581cc8daacdd109aeed3c007d908bc9ea42 (diff)
improve find_tool
-rw-r--r--xmake/modules/lib/detect/find_tool.lua11
-rw-r--r--xmake/toolchains/rust/xmake.lua2
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)