make-lsp: Support Makefiles using cc/cxx/c++

This commit is contained in:
Andrew Rogers 2023-10-09 02:46:36 -05:00
commit abd0a7dd01

View file

@ -46,9 +46,11 @@ done
shift $((OPTIND-1)) shift $((OPTIND-1))
COMPILER_RX='^\s*cc|^\s*cxx|^\s*c\+\+|^\s*gcc|^\s*g\+\+|^\s*clang|^\s*clang\+\+'
[ "$DEBUG" -ne 0 ] && set -x [ "$DEBUG" -ne 0 ] && set -x
make "$MAKEDIR" "$MAKEFILE" --always-make --dry-run ${@} \ make "$MAKEDIR" "$MAKEFILE" --always-make --dry-run ${@} \
| grep -E '^\s*gcc|^\s*g\+\+|^\s*clang|^\s*clang\+\+' \ | grep -E "$COMPILER_RX" \
| grep -w '\-c' \ | grep -w '\-c' \
| jq -nR '[inputs|{directory:".", command:., file: match(" [^ ]+$").string[1:]}]' | jq -nR '[inputs|{directory:".", command:., file: match(" [^ ]+$").string[1:]}]'