summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-03-08 15:29:33 +0800
committerGitHub <[email protected]>2022-03-08 15:29:33 +0800
commit8189e699c432899ac6621ba31e00a05ce5d95cf1 (patch)
tree6c27ddc0cf74201b0a47e3ceebccf2559474d0ac
parentcca4f1aaf5ebf2a3a513520645d4d04f89373913 (diff)
parent83dca1f40763e323e48dda90d18d6054289f5640 (diff)
Merge pull request #2135 from xq114/dev
fix cuda tool finding
-rw-r--r--xmake/modules/private/detect/find_cudatool.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/xmake/modules/private/detect/find_cudatool.lua b/xmake/modules/private/detect/find_cudatool.lua
index b5e211d14..374ff9906 100644
--- a/xmake/modules/private/detect/find_cudatool.lua
+++ b/xmake/modules/private/detect/find_cudatool.lua
@@ -45,15 +45,15 @@ function main(toolname, parse, opt)
opt = opt or {}
opt.parse = opt.parse or parse
- -- always keep consistency with cuda cache
+ -- always keep consistency with cuda cache
+ local program
local toolchains = find_cuda()
if toolchains and toolchains.bindir then
program = find_program(path.join(toolchains.bindir, opt.program or toolname), opt)
end
-- not found? attempt to find program only
- local program = nil
- if opt.program then
+ if not program then
program = find_program(opt.program or toolname, opt)
end
@@ -62,7 +62,5 @@ function main(toolname, parse, opt)
if program and opt.version then
version = find_programver(program, opt)
end
-
- -- ok?
return program, version
end