Files
third_party_mesa3d/.gitlab-ci/build/g++-link-werror.sh

16 lines
494 B
Bash
Executable File

#!/bin/sh -e
if [ "$(ps -p $(ps -p $PPID -o ppid --no-headers) -o comm --no-headers)" != ninja ]; then
# Not invoked by ninja (e.g. for a meson feature check)
exec g++ "$@"
fi
if [ "$(eval printf "'%s'" "\"\${$(($#-1))}\"")" = "-c" ]; then
# Not invoked for linking
exec g++ "$@"
fi
# Compiler invoked by ninja for linking. Add -Werror to turn compiler warnings into errors
# with LTO. (meson's werror should arguably do this, but meanwhile we need to)
exec g++ "$@" -Werror