add compiler options to C header checking too

This commit is contained in:
kongo2002 2012-09-23 22:58:42 +02:00
parent acb35ec088
commit 1bbfbeb3a3
2 changed files with 6 additions and 5 deletions

View File

@ -106,8 +106,9 @@ function! SyntaxCheckers_c_GetLocList()
" determine whether to parse header files as well
if expand('%') =~? '.h$'
if exists('g:syntastic_c_check_header')
let makeprg = 'gcc -c '.shellescape(expand('%')).
\ ' '.syntastic#c#GetIncludeDirs('c')
let makeprg = 'gcc -c '.shellescape(expand('%')) .
\ ' ' . g:syntastic_c_compiler_options .
\ ' ' . syntastic#c#GetIncludeDirs('c')
else
return []
endif

View File

@ -66,7 +66,7 @@
"
" Set your compiler executable with e.g. (defaults to g++)
"
" let g:syntastic_cpp_compiler = 'clang++'
" let g:syntastic_cpp_compiler = 'clang++'
if exists('loaded_cpp_syntax_checker')
finish
@ -107,8 +107,8 @@ function! SyntaxCheckers_cpp_GetLocList()
if expand('%') =~? '\%(.h\|.hpp\|.hh\)$'
if exists('g:syntastic_cpp_check_header')
let makeprg = g:syntastic_cpp_compiler.' -c '.shellescape(expand('%')).
\ ' ' . g:syntastic_cpp_compiler_options.
let makeprg = g:syntastic_cpp_compiler.' -c '.shellescape(expand('%')) .
\ ' ' . g:syntastic_cpp_compiler_options .
\ ' ' . syntastic#c#GetIncludeDirs('cpp')
else
return []