User libraries are added to PATH for windows system.

Also, if the buffer is not saved then user is notified about that instead of compiling the version on disk.
This commit is contained in:
2013-06-22 23:00:42 +04:00
parent 96acfe3416
commit 0c99ee6dfd

View File

@@ -22,7 +22,7 @@ function! s:CompileMSVC() "{{{2
let exename=expand("%:p:r:s,$,.exe,") let exename=expand("%:p:r:s,$,.exe,")
let srcname=expand("%") let srcname=expand("%")
" compile it " compile it
let ccline="cl ".$CXXFLAGS." ".g:cppflags." ".g:wcppflags." ".srcname." /Fe".exename." /link ".$LDFLAGS let ccline="cl ".g:cppflags." ".g:wcppflags." ".srcname." /Fe".exename." /link ".g:ldflags
echo ccline echo ccline
let cout = system( ccline ) let cout = system( ccline )
if v:shell_error if v:shell_error
@@ -31,9 +31,10 @@ function! s:CompileMSVC() "{{{2
endif endif
echo cout echo cout
" run it " run it
let cmd = exename . " " . g:argv let cmdline="\"set PATH=".g:ldlibpath.$PATH." && ".exename." ".g:argv."\""
echo cmd echo exename." ".g:argv
let eout = system( cmd ) "echo cmdline
let eout = system( cmdline )
echo eout echo eout
endfunction endfunction
@@ -72,7 +73,7 @@ function! s:CompileGCC() "{{{2
let exename=expand("%:p:r:s,$,.exe,") let exename=expand("%:p:r:s,$,.exe,")
let srcname=expand("%") let srcname=expand("%")
" compile it " compile it
let ccline="g++ ".g:cppflags." ".g:lcppflags." ".srcname." -o".exename let ccline="g++ ".g:cppflags." ".g:lcppflags." ".g:ldflags." ".srcname." -o".exename
call s:appendOutput(ccline) call s:appendOutput(ccline)
let cout = system( ccline ) let cout = system( ccline )
if v:shell_error if v:shell_error
@@ -152,12 +153,17 @@ function! s:initDefaults()
let g:cppflags="" let g:cppflags=""
let g:wcppflags="/O2 /EHsc /DWIN32" let g:wcppflags="/O2 /EHsc /DWIN32"
let g:lcppflags="-O2" let g:lcppflags="-O2"
let g:ldflags=""
let g:ldlibpath="" let g:ldlibpath=""
endfunction endfunction
" "
" Load compile instructions and call window or linux compiler. {{{1 " Load compile instructions and call window or linux compiler. {{{1
" "
function! CF5Compile() function! CF5Compile()
if &modified == 1
echo "The buffer is not saved. First save it."
return
endif
" "
" First init global variables to let cf5-opt override it. " First init global variables to let cf5-opt override it.
" "