summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-07-11 13:44:13 +0800
committerOpportunityLiu <[email protected]>2019-07-11 13:44:13 +0800
commit784f2fb015f748cd381fb5a8a2098d7a7255ac74 (patch)
tree730cc197fc5e28a18b0a1df128190a6d91bf1f84
parentc43290bea303900e334243e4b38a8f4f72b8cf9d (diff)
improve find_cuda
-rw-r--r--xmake/modules/detect/sdks/find_cuda.lua5
1 files changed, 4 insertions, 1 deletions
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)