summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-02-24 21:05:24 +0800
committerruki <[email protected]>2024-02-24 21:05:24 +0800
commita91f084c0227f3a0ac98964d4676de321ab10219 (patch)
treeddade71f42ef924c1c4d37129317ef9b35f666a0
parented9205400c40454cb93b0671565a346cf2ffdefa (diff)
improve to find cuda
-rw-r--r--xmake/modules/private/detect/find_cudatool.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/xmake/modules/private/detect/find_cudatool.lua b/xmake/modules/private/detect/find_cudatool.lua
index 374ff9906..b911615ec 100644
--- a/xmake/modules/private/detect/find_cudatool.lua
+++ b/xmake/modules/private/detect/find_cudatool.lua
@@ -49,7 +49,10 @@ function main(toolname, parse, opt)
local program
local toolchains = find_cuda()
if toolchains and toolchains.bindir then
- program = find_program(path.join(toolchains.bindir, opt.program or toolname), opt)
+ local file = path.join(toolchains.bindir, opt.program or toolname)
+ if os.isfile(file) then
+ program = find_program(file, opt)
+ end
end
-- not found? attempt to find program only