Fix #3247 - Use --always-make for make -n by default

This commit is contained in:
w0rp
2020-08-29 16:05:49 +01:00
parent bc3a843e10
commit 7e0cdb53ec
4 changed files with 43 additions and 1 deletions

View File

@@ -2,7 +2,9 @@
" Description: Functions for integrating with C-family linters.
call ale#Set('c_parse_makefile', 0)
call ale#Set('c_always_make', has('unix') && !has('macunix'))
call ale#Set('c_parse_compile_commands', 1)
let s:sep = has('win32') ? '\' : '/'
" Set just so tests can override it.
@@ -504,7 +506,10 @@ function! ale#c#GetMakeCommand(buffer) abort
let l:path = ale#path#FindNearestFile(a:buffer, 'Makefile')
if !empty(l:path)
return ale#path#CdString(fnamemodify(l:path, ':h')) . 'make -n'
let l:always_make = ale#Var(a:buffer, 'c_always_make')
return ale#path#CdString(fnamemodify(l:path, ':h'))
\ . 'make -n' . (l:always_make ? ' --always-make' : '')
endif
endif