diff options
| author | OpportunityLiu <[email protected]> | 2019-06-18 18:10:48 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-06-18 18:10:48 +0800 |
| commit | 026a8aa6a02bf9c12790404b9c551abf3dfd261b (patch) | |
| tree | 13c9acd6bf397fbe8a1d0c121685693b9cffda34 /xmake/modules/detect/tools | |
| parent | 9c8b83a61fce275edd3808c54f36ba368378fa5d (diff) | |
fix find_program & find_file
add path.splitenv
Diffstat (limited to 'xmake/modules/detect/tools')
| -rw-r--r-- | xmake/modules/detect/tools/find_nvcc.lua | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/xmake/modules/detect/tools/find_nvcc.lua b/xmake/modules/detect/tools/find_nvcc.lua index 5b00510c1..5cd11e3dc 100644 --- a/xmake/modules/detect/tools/find_nvcc.lua +++ b/xmake/modules/detect/tools/find_nvcc.lua @@ -43,8 +43,12 @@ function main(opt) opt = opt or {} opt.parse = opt.parse or "V(%d+%.?%d*%.?%d*.-)%s" + local program = nil + -- find program - local program = find_program(opt.program or "nvcc", opt) + if opt.program then + program = find_program(opt.program, opt) + end -- not found? attempt to find program from cuda toolchains if not program then @@ -54,9 +58,14 @@ function main(opt) end end + -- not found? attempt to find program from PATH + if not program then + program = find_program("nvcc", opt) + end + -- find program version local version = nil - if program and opt and opt.version then + if program and opt.version then version = find_programver(program, opt) end |
