diff options
| author | ruki <[email protected]> | 2018-03-09 23:54:33 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-03-09 17:27:21 +0800 |
| commit | 1fe2e277250905bec5731912f8baac3a5cff40b0 (patch) | |
| tree | 6cc94b2997be52311d8d3878db8c90da516f77e4 | |
| parent | f0cdab9b3b1d2e593fa57ed29b06b828d113462e (diff) | |
parse nvcc version
| -rw-r--r-- | xmake/modules/detect/tools/find_nvcc.lua | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/xmake/modules/detect/tools/find_nvcc.lua b/xmake/modules/detect/tools/find_nvcc.lua index 1944915af..6e361dd9c 100644 --- a/xmake/modules/detect/tools/find_nvcc.lua +++ b/xmake/modules/detect/tools/find_nvcc.lua @@ -44,19 +44,17 @@ import("detect.sdks.find_cuda_toolchains") function main(opt) -- init options - opt = opt or {} + opt = opt or {} + opt.parse = opt.parse or "V(%d+%.?%d*%.?%d*.-)%s" -- find program local program = find_program(opt.program or "nvcc", opt) -- not found? attempt to find program from cuda toolchains if not program then - local cudadir = config.get("cuda_dir") - if cudadir then - local toolchains = find_cuda_toolchains(cudadir) - if toolchains and toolchains.bindir then - program = find_program(path.join(toolchains.bindir, "nvcc"), opt) - end + local toolchains = find_cuda_toolchains(config.get("cuda_dir")) + if toolchains and toolchains.bindir then + program = find_program(path.join(toolchains.bindir, "nvcc"), opt) end end |
