gitlab-ci: Run the GLES2 CTS on llvmpipe.
[mesa.git] / .gitlab-ci / meson-build.sh
1 #!/bin/bash
2
3 set -e
4 set -o xtrace
5
6 # We need to control the version of llvm-config we're using, so we'll
7 # generate a native file to do so. This requires meson >=0.49
8 if test -n "$LLVM_VERSION"; then
9 LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
10 echo -e "[binaries]\nllvm-config = '`which $LLVM_CONFIG`'" > native.file
11 $LLVM_CONFIG --version
12 else
13 rm -f native.file
14 touch native.file
15 fi
16
17 rm -rf _build
18 meson _build --native-file=native.file \
19 ${CROSS+--cross /cross_file-$CROSS.txt} \
20 -D prefix=`pwd`/install \
21 -D libdir=lib \
22 -D buildtype=${BUILDTYPE:-debug} \
23 -D build-tests=true \
24 -D libunwind=${UNWIND} \
25 ${DRI_LOADERS} \
26 -D dri-drivers=${DRI_DRIVERS:-[]} \
27 ${GALLIUM_ST} \
28 -D gallium-drivers=${GALLIUM_DRIVERS:-[]} \
29 -D vulkan-drivers=${VULKAN_DRIVERS:-[]} \
30 -D I-love-half-baked-turnips=true \
31 ${EXTRA_OPTION}
32 cd _build
33 meson configure
34 ninja -j4
35 LC_ALL=C.UTF-8 ninja test
36 ninja install
37 cd ..
38
39 if test -n "$MESON_SHADERDB"; then
40 ./.gitlab-ci/run-shader-db.sh;
41 fi
42
43 # Delete 2MB of includes from artifacts.
44 rm -rf install/include
45
46 # Strip the drivers in the artifacts to cut 80% of the artifacts size.
47 if [ -n "$CROSS" ]; then
48 STRIP=`sed -n -E "s/strip\s*=\s*'(.*)'/\1/p" /cross_file-$CROSS.txt`
49 if [ -z "$STRIP" ]; then
50 echo "Failed to find strip command in cross file"
51 exit 1
52 fi
53 else
54 STRIP="strip"
55 fi
56 find install -name \*.so -exec $STRIP {} \;
57
58 # Test runs don't pull down the git tree, so put the dEQP helper
59 # script and associated bits there.
60 mkdir -p artifacts/
61 cp -Rp .gitlab-ci/deqp* artifacts/
62 # cp -Rp src/freedreno/ci/expected* artifacts/