From 9e14dfba002bf9cbaed24539e7f7439ecf6b339a Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Tue, 8 Mar 2022 15:15:05 +0800 Subject: fix cuda tool finding --- xmake/modules/private/detect/find_cudatool.lua | 7 ++++--- 1 file 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 -- cgit v1.3.1 From 83dca1f40763e323e48dda90d18d6054289f5640 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 8 Mar 2022 15:29:23 +0800 Subject: Update find_cudatool.lua --- xmake/modules/private/detect/find_cudatool.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/xmake/modules/private/detect/find_cudatool.lua b/xmake/modules/private/detect/find_cudatool.lua index 7085bc0e4..374ff9906 100644 --- a/xmake/modules/private/detect/find_cudatool.lua +++ b/xmake/modules/private/detect/find_cudatool.lua @@ -45,9 +45,8 @@ function main(toolname, parse, opt) opt = opt or {} opt.parse = opt.parse or parse - local program = nil - -- 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) @@ -63,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 -- cgit v1.3.1