• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# shellcheck disable=SC1091
2# shellcheck disable=SC2086 # we want word splitting
3if command -V ccache >/dev/null 2>/dev/null; then
4  CCACHE=ccache
5else
6  CCACHE=
7fi
8
9if echo "$@" | grep -E 'meson-private/tmp[^ /]*/testfile.c' >/dev/null; then
10    # Invoked for meson feature check
11    exec $CCACHE $_COMPILER "$@"
12fi
13
14if [ "$(eval printf "'%s'" "\"\${$(($#-1))}\"")" = "-c" ]; then
15    # Not invoked for linking
16    exec $CCACHE $_COMPILER "$@"
17fi
18
19# Compiler invoked by ninja for linking. Add -Werror to turn compiler warnings into errors
20# with LTO. (meson's werror should arguably do this, but meanwhile we need to)
21exec $CCACHE $_COMPILER "$@" -Werror
22