ci: deduplicate compiler wrappers
Signed-off-by: Eric Engestrom <eric@igalia.com> Suggested-by: Michel Dänzer <mdaenzer@redhat.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
16d5f65502
commit
63f1b4531b
@@ -1,21 +0,0 @@
|
||||
#!/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
|
3
.gitlab-ci/build/compiler-wrapper-clang++.sh
Executable file
3
.gitlab-ci/build/compiler-wrapper-clang++.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
_COMPILER=clang++
|
||||
. compiler-wrapper.sh
|
3
.gitlab-ci/build/compiler-wrapper-clang.sh
Executable file
3
.gitlab-ci/build/compiler-wrapper-clang.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
_COMPILER=clang
|
||||
. compiler-wrapper.sh
|
3
.gitlab-ci/build/compiler-wrapper-g++.sh
Executable file
3
.gitlab-ci/build/compiler-wrapper-g++.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
_COMPILER=g++
|
||||
. compiler-wrapper.sh
|
3
.gitlab-ci/build/compiler-wrapper-gcc.sh
Executable file
3
.gitlab-ci/build/compiler-wrapper-gcc.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
_COMPILER=gcc
|
||||
. compiler-wrapper.sh
|
@@ -8,14 +8,14 @@ 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++ "$@"
|
||||
exec $CCACHE $_COMPILER "$@"
|
||||
fi
|
||||
|
||||
if [ "$(eval printf "'%s'" "\"\${$(($#-1))}\"")" = "-c" ]; then
|
||||
# Not invoked for linking
|
||||
exec $CCACHE clang++ "$@"
|
||||
exec $CCACHE $_COMPILER "$@"
|
||||
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
|
||||
exec $CCACHE $_COMPILER "$@" -Werror
|
@@ -1,21 +0,0 @@
|
||||
#!/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 g++ "$@"
|
||||
fi
|
||||
|
||||
if [ "$(eval printf "'%s'" "\"\${$(($#-1))}\"")" = "-c" ]; then
|
||||
# Not invoked for linking
|
||||
exec $CCACHE 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 $CCACHE g++ "$@" -Werror
|
@@ -1,21 +0,0 @@
|
||||
#!/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 gcc "$@"
|
||||
fi
|
||||
|
||||
if [ "$(eval printf "'%s'" "\"\${$(($#-1))}\"")" = "-c" ]; then
|
||||
# Not invoked for linking
|
||||
exec $CCACHE gcc "$@"
|
||||
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 gcc "$@" -Werror
|
@@ -12,8 +12,8 @@ export PATH=$PATH:$PWD/.gitlab-ci/build
|
||||
touch native.file
|
||||
printf > native.file "%s\n" \
|
||||
"[binaries]" \
|
||||
"c = '${CC:-gcc}-link-werror.sh'" \
|
||||
"cpp = '${CXX:-g++}-link-werror.sh'"
|
||||
"c = 'compiler-wrapper-${CC:-gcc}.sh'" \
|
||||
"cpp = 'compiler-wrapper-${CXX:-g++}.sh'"
|
||||
|
||||
# We need to control the version of llvm-config we're using, so we'll
|
||||
# tweak the cross file or generate a native file to do so.
|
||||
|
Reference in New Issue
Block a user