fix custom c++ compiler options

This commit is contained in:
kongo2002 2012-03-11 19:33:10 +01:00
parent 7a5bca349c
commit 85c347c14f

View File

@ -65,10 +65,16 @@ let s:save_cpo = &cpo
set cpo&vim set cpo&vim
function! SyntaxCheckers_cpp_GetLocList() function! SyntaxCheckers_cpp_GetLocList()
let makeprg = 'g++ -fsyntax-only '.shellescape(expand('%')). let makeprg = 'g++ -fsyntax-only '
\ ' ' . syntastic#c#GetIncludeDirs(1)
let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m' let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m'
if exists('g:syntastic_cpp_compiler_options')
let makeprg .= g:syntastic_cpp_compiler_options
endif
let makeprg .= ' ' . shellescape(expand('%')) .
\ ' ' . syntastic#c#GetIncludeDirs(1)
if expand('%') =~? '\%(.h\|.hpp\|.hh\)$' if expand('%') =~? '\%(.h\|.hpp\|.hh\)$'
if exists('g:syntastic_cpp_check_header') if exists('g:syntastic_cpp_check_header')
let makeprg = 'g++ -c '.shellescape(expand('%')). let makeprg = 'g++ -c '.shellescape(expand('%')).
@ -78,10 +84,6 @@ function! SyntaxCheckers_cpp_GetLocList()
endif endif
endif endif
if exists('g:syntastic_cpp_compiler_options')
let makeprg .= g:syntastic_cpp_compiler_options
endif
if !exists('b:syntastic_cpp_cflags') if !exists('b:syntastic_cpp_cflags')
if !exists('g:syntastic_cpp_no_include_search') || if !exists('g:syntastic_cpp_no_include_search') ||
\ g:syntastic_cpp_no_include_search != 1 \ g:syntastic_cpp_no_include_search != 1