From 784f2fb015f748cd381fb5a8a2098d7a7255ac74 Mon Sep 17 00:00:00 2001 From: OpportunityLiu Date: Thu, 11 Jul 2019 13:44:13 +0800 Subject: improve find_cuda --- xmake/modules/detect/sdks/find_cuda.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xmake/modules/detect/sdks/find_cuda.lua b/xmake/modules/detect/sdks/find_cuda.lua index b7fb4911e..87ac6f3a1 100644 --- a/xmake/modules/detect/sdks/find_cuda.lua +++ b/xmake/modules/detect/sdks/find_cuda.lua @@ -31,13 +31,16 @@ function _find_sdkdir() -- init the search directories local pathes = {} if os.host() == "macosx" then + table.insert(pathes, "/Developer/NVIDIA/CUDA/bin") table.insert(pathes, "/Developer/NVIDIA/CUDA*/bin") elseif os.host() == "windows" then table.insert(pathes, "$(env CUDA_PATH)/bin") else + -- find from default symbol link dir + table.insert(pathes, "/usr/local/cuda/bin") table.insert(pathes, "/usr/local/cuda*/bin") end - table.insert(pathes, "$(env PATH)") + table.join2(pathes, path.splitenv(os.getenv("PATH"))) -- attempt to find nvcc local nvcc = find_file(os.host() == "windows" and "nvcc.exe" or "nvcc", pathes) -- cgit v1.3.1