diff options
| author | xq114 <[email protected]> | 2022-02-14 14:11:22 +0800 |
|---|---|---|
| committer | xq114 <[email protected]> | 2022-02-14 14:11:22 +0800 |
| commit | 8db12ca9db80a84fccb5a3d422fc2703a0f024e1 (patch) | |
| tree | bf0466753f7d0d0dcfea748a7cda09882c7b53ab /xmake/modules/private/detect/find_cudatool.lua | |
| parent | cd2ce73cda749e93b6a53fd03c96136e903296c0 (diff) | |
improve cuda finding
Diffstat (limited to 'xmake/modules/private/detect/find_cudatool.lua')
| -rw-r--r-- | xmake/modules/private/detect/find_cudatool.lua | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/xmake/modules/private/detect/find_cudatool.lua b/xmake/modules/private/detect/find_cudatool.lua index 6b0630ece..b5e211d14 100644 --- a/xmake/modules/private/detect/find_cudatool.lua +++ b/xmake/modules/private/detect/find_cudatool.lua @@ -45,23 +45,16 @@ function main(toolname, parse, opt) opt = opt or {} opt.parse = opt.parse or parse - -- find program - local program = nil - if opt.program then - program = find_program(opt.program, opt) - end - - -- not found? attempt to find program from cuda toolchains - if not program then - local toolchains = find_cuda() - if toolchains and toolchains.bindir then - program = find_program(path.join(toolchains.bindir, toolname), opt) - end + -- 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 from PATH - if not program then - program = find_program(toolname, opt) + -- not found? attempt to find program only + local program = nil + if opt.program then + program = find_program(opt.program or toolname, opt) end -- find program version |
