cuda: simplify/fix the executable checking
Remove the g:syntastic_nvcc_binary option as this should be in the users path - or at least symlinked in. Also, the logic was broken in that the script was hardcoded to only accept '/usr/local/cuda/bin/nvcc' as the binary anyway.
This commit is contained in:
parent
ae5171e453
commit
42ea3426d1
@ -16,21 +16,18 @@ if exists('loaded_cuda_syntax_checker')
|
|||||||
endif
|
endif
|
||||||
let loaded_cuda_syntax_checker = 1
|
let loaded_cuda_syntax_checker = 1
|
||||||
|
|
||||||
if !exists('g:syntastic_nvcc_binary')
|
if !executable('nvcc')
|
||||||
let g:syntastic_nvcc_binary = '/usr/local/cuda/bin/nvcc'
|
|
||||||
endif
|
|
||||||
if !executable('/usr/local/cuda/bin/nvcc')
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! SyntaxCheckers_cuda_GetLocList()
|
function! SyntaxCheckers_cuda_GetLocList()
|
||||||
let makeprg = g:syntastic_nvcc_binary.' --cuda -O0 -I . -Xcompiler -fsyntax-only '.shellescape(expand('%')).' -o /dev/null'
|
let makeprg = 'nvcc --cuda -O0 -I . -Xcompiler -fsyntax-only '.shellescape(expand('%')).' -o /dev/null'
|
||||||
"let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m'
|
"let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m'
|
||||||
let errorformat = '%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory `%f'',%X%*\a[%*\d]: Leaving directory `%f'',%D%*\a: Entering directory `%f'',%X%*\a: Leaving directory `%f'',%DMaking %*\a in %f,%f|%l| %m'
|
let errorformat = '%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory `%f'',%X%*\a[%*\d]: Leaving directory `%f'',%D%*\a: Entering directory `%f'',%X%*\a: Leaving directory `%f'',%DMaking %*\a in %f,%f|%l| %m'
|
||||||
|
|
||||||
if expand('%') =~? '\%(.h\|.hpp\|.cuh\)$'
|
if expand('%') =~? '\%(.h\|.hpp\|.cuh\)$'
|
||||||
if exists('g:syntastic_cuda_check_header')
|
if exists('g:syntastic_cuda_check_header')
|
||||||
let makeprg = 'echo > .syntastic_dummy.cu ; '.g:syntastic_nvcc_binary.' --cuda -O0 -I . .syntastic_dummy.cu -Xcompiler -fsyntax-only -include '.shellescape(expand('%')).' -o /dev/null'
|
let makeprg = 'echo > .syntastic_dummy.cu ; nvcc --cuda -O0 -I . .syntastic_dummy.cu -Xcompiler -fsyntax-only -include '.shellescape(expand('%')).' -o /dev/null'
|
||||||
else
|
else
|
||||||
return []
|
return []
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user