summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-07-11 17:22:44 +0800
committerGitHub <[email protected]>2019-07-11 17:22:44 +0800
commit4bc4a680ec5b6769955f655aa0bc0c0da56cbe80 (patch)
tree31f3c0c1a5a26d3fafb0d65fae89ce2ca45c61c6
parentc43290bea303900e334243e4b38a8f4f72b8cf9d (diff)
parentb11c6f57662624732501045e6cccf6b6188dacee (diff)
Merge pull request #481 from OpportunityLiu/improve-find_cuda
improve find_cuda
-rw-r--r--xmake/core/sandbox/modules/import/lib/detect/find_file.lua2
-rw-r--r--xmake/core/sandbox/modules/import/lib/detect/find_program.lua2
-rw-r--r--xmake/modules/detect/sdks/find_cuda.lua3
3 files changed, 5 insertions, 2 deletions
diff --git a/xmake/core/sandbox/modules/import/lib/detect/find_file.lua b/xmake/core/sandbox/modules/import/lib/detect/find_file.lua
index 2d64d6067..45a3ebd8a 100644
--- a/xmake/core/sandbox/modules/import/lib/detect/find_file.lua
+++ b/xmake/core/sandbox/modules/import/lib/detect/find_file.lua
@@ -82,7 +82,7 @@ function sandbox_lib_detect_find_file.main(name, pathes, opt)
raise(results)
end
elseif type(_path) == "string" then
- if _path:match("^%$%($s*env%s+%S+%s*%)$") then
+ if _path:match("^%$%(env .+%)$") then
_path = path.splitenv(vformat(_path))
else
_path = vformat(_path)
diff --git a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua
index bfc21f35c..f8a62ceaf 100644
--- a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua
+++ b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua
@@ -91,7 +91,7 @@ function sandbox_lib_detect_find_program._find_from_pathes(name, pathes, opt)
raise(results)
end
elseif type(_path) == "string" then
- if _path:match("^%$%($s*env%s+%S+%s*%)$") then
+ if _path:match("^%$%(env .+%)$") then
_path = path.splitenv(vformat(_path))
else
_path = vformat(_path)
diff --git a/xmake/modules/detect/sdks/find_cuda.lua b/xmake/modules/detect/sdks/find_cuda.lua
index b7fb4911e..54b8f21cf 100644
--- a/xmake/modules/detect/sdks/find_cuda.lua
+++ b/xmake/modules/detect/sdks/find_cuda.lua
@@ -31,10 +31,13 @@ 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)")