summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxq114 <[email protected]>2022-03-08 15:15:05 +0800
committerxq114 <[email protected]>2022-03-08 15:15:05 +0800
commit9e14dfba002bf9cbaed24539e7f7439ecf6b339a (patch)
tree692097b1b1a8ddacde1842273c664e6b32cf2dac
parent9361ffcc1a64725cf5a909f5d434338816c7ad0b (diff)
fix cuda tool finding
-rw-r--r--xmake/modules/private/detect/find_cudatool.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/xmake/modules/private/detect/find_cudatool.lua b/xmake/modules/private/detect/find_cudatool.lua
index b5e211d14..7085bc0e4 100644
--- a/xmake/modules/private/detect/find_cudatool.lua
+++ b/xmake/modules/private/detect/find_cudatool.lua
@@ -45,15 +45,16 @@ function main(toolname, parse, opt)
opt = opt or {}
opt.parse = opt.parse or parse
- -- always keep consistency with cuda cache
+ local program = nil
+
+ -- always keep consistency with cuda cache
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