From 7d779bd61133c455cc9b59a9e68820a3a9e3a754 Mon Sep 17 00:00:00 2001 From: charles seizilles Date: Thu, 21 Mar 2024 16:17:00 +0100 Subject: fix find_cudatools on windows --- xmake/modules/private/detect/find_cudatool.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xmake/modules/private/detect/find_cudatool.lua b/xmake/modules/private/detect/find_cudatool.lua index b911615ec..46aae0b27 100644 --- a/xmake/modules/private/detect/find_cudatool.lua +++ b/xmake/modules/private/detect/find_cudatool.lua @@ -49,10 +49,13 @@ function main(toolname, parse, opt) local program local toolchains = find_cuda() if toolchains and toolchains.bindir then - local file = path.join(toolchains.bindir, opt.program or toolname) - if os.isfile(file) then - program = find_program(file, opt) - end + -- prepend the toolchain's bin dir to the paths + local opt2 = table.join(opt) -- duplicate opt + local paths = table.join(opt2.paths or {}, opt2.pathes or {}) + opt2.paths = table.join({toolchains.bindir}, paths) + opt2.pathes = nil + + program = find_program(opt2.program or toolname, opt2) end -- not found? attempt to find program only -- cgit v1.3.1 From ec1e44435eb6a25c52c18d7f779d8ff1c62eb9f5 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 22 Mar 2024 09:32:27 +0800 Subject: Update find_cudatool.lua --- xmake/modules/private/detect/find_cudatool.lua | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/xmake/modules/private/detect/find_cudatool.lua b/xmake/modules/private/detect/find_cudatool.lua index 46aae0b27..e5cc282c8 100644 --- a/xmake/modules/private/detect/find_cudatool.lua +++ b/xmake/modules/private/detect/find_cudatool.lua @@ -49,12 +49,9 @@ function main(toolname, parse, opt) local program local toolchains = find_cuda() if toolchains and toolchains.bindir then - -- prepend the toolchain's bin dir to the paths - local opt2 = table.join(opt) -- duplicate opt - local paths = table.join(opt2.paths or {}, opt2.pathes or {}) - opt2.paths = table.join({toolchains.bindir}, paths) - opt2.pathes = nil - + local opt2 = table.clone(opt) + opt2.paths = opt2.paths or {} + table.insert(opt2.paths, toolchains.bindir) program = find_program(opt2.program or toolname, opt2) end -- cgit v1.3.1