add ReadConfig to C++ checker as well

This commit is contained in:
kongo2002 2012-03-27 22:28:35 +02:00
parent c791c3103e
commit 0f1ea022e9

View File

@ -46,6 +46,13 @@
" "
" let g:syntastic_cpp_compiler_options = ' -std=c++0x' " let g:syntastic_cpp_compiler_options = ' -std=c++0x'
" "
" Additionally the setting 'g:syntastic_cpp_config_file' allows you to define
" a file that contains additional compiler arguments like include directories
" or CFLAGS. The file is expected to contain one option per line. If none is
" given the filename defaults to '.syntastic_cpp_config':
"
" let g:syntastic_cpp_config_file = '.config'
"
" Using the global variable 'g:syntastic_cpp_remove_include_errors' you can " Using the global variable 'g:syntastic_cpp_remove_include_errors' you can
" specify whether errors of files included via the " specify whether errors of files included via the
" g:syntastic_cpp_include_dirs' setting are removed from the result set: " g:syntastic_cpp_include_dirs' setting are removed from the result set:
@ -64,6 +71,10 @@ endif
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
if !exists('g:syntastic_cpp_config_file')
let g:syntastic_cpp_config_file = '.syntastic_cpp_config'
endif
function! SyntaxCheckers_cpp_GetLocList() function! SyntaxCheckers_cpp_GetLocList()
let makeprg = 'g++ -fsyntax-only ' let makeprg = 'g++ -fsyntax-only '
let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m' let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m'
@ -101,6 +112,9 @@ function! SyntaxCheckers_cpp_GetLocList()
let makeprg .= b:syntastic_cpp_cflags let makeprg .= b:syntastic_cpp_cflags
endif endif
" add optional config file parameters
let makeprg .= syntastic#c#ReadConfig(g:syntastic_cpp_config_file)
" process makeprg " process makeprg
let errors = SyntasticMake({ 'makeprg': makeprg, let errors = SyntasticMake({ 'makeprg': makeprg,
\ 'errorformat': errorformat }) \ 'errorformat': errorformat })