ci: add linker wrapper for clang
Signed-off-by: Eric Engestrom <eric@igalia.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21997>
This commit is contained in:

committed by
Marge Bot

parent
6a0f12ba5f
commit
dc53b39173
21
.gitlab-ci/build/clang++-link-werror.sh
Executable file
21
.gitlab-ci/build/clang++-link-werror.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
if command -V ccache >/dev/null 2>/dev/null; then
|
||||
CCACHE=ccache
|
||||
else
|
||||
CCACHE=
|
||||
fi
|
||||
|
||||
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 $CCACHE clang++ "$@"
|
||||
fi
|
||||
|
||||
if [ "$(eval printf "'%s'" "\"\${$(($#-1))}\"")" = "-c" ]; then
|
||||
# Not invoked for linking
|
||||
exec $CCACHE clang++ "$@"
|
||||
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 $CCACHE clang++ "$@" -Werror
|
21
.gitlab-ci/build/clang-link-werror.sh
Executable file
21
.gitlab-ci/build/clang-link-werror.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
if command -V ccache >/dev/null 2>/dev/null; then
|
||||
CCACHE=ccache
|
||||
else
|
||||
CCACHE=
|
||||
fi
|
||||
|
||||
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 $CCACHE clang "$@"
|
||||
fi
|
||||
|
||||
if [ "$(eval printf "'%s'" "\"\${$(($#-1))}\"")" = "-c" ]; then
|
||||
# Not invoked for linking
|
||||
exec $CCACHE clang "$@"
|
||||
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 $CCACHE clang "$@" -Werror
|
Reference in New Issue
Block a user