blob: c6affea46da5f061b7738c40feb3f6bf36bbdc2c [file] [log] [blame]
Michel Dänzercc2b3a92019-05-03 10:49:43 +02001#!/bin/bash
2
3set -e
4set -o xtrace
5
Michel Dänzer59e7f142019-10-11 15:43:34 +02006CROSS_FILE=/cross_file-"$CROSS".txt
7
Michel Dänzercc2b3a92019-05-03 10:49:43 +02008# We need to control the version of llvm-config we're using, so we'll
Michel Dänzer59e7f142019-10-11 15:43:34 +02009# tweak the cross file or generate a native file to do so.
Michel Dänzercc2b3a92019-05-03 10:49:43 +020010if test -n "$LLVM_VERSION"; then
11 LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
12 echo -e "[binaries]\nllvm-config = '`which $LLVM_CONFIG`'" > native.file
Michel Dänzer59e7f142019-10-11 15:43:34 +020013 if [ -n "$CROSS" ]; then
14 sed -i -e '/\[binaries\]/a\' -e "llvm-config = '`which $LLVM_CONFIG`'" $CROSS_FILE
15 fi
Michel Dänzercc2b3a92019-05-03 10:49:43 +020016 $LLVM_CONFIG --version
17else
Michel Dänzer68977152019-05-03 10:58:48 +020018 rm -f native.file
Michel Dänzercc2b3a92019-05-03 10:49:43 +020019 touch native.file
20fi
21
Adam Jackson6ec12592019-09-16 20:44:12 -040022# cross-xfail-$CROSS, if it exists, contains a list of tests that are expected
23# to fail for the $CROSS configuration, one per line. you can then mark those
24# tests in their meson.build with:
25#
26# test(...,
27# should_fail: meson.get_cross_property('xfail', '').contains(t),
28# )
29#
30# where t is the name of the test, and the '' is the string to search when
31# not cross-compiling (which is empty, because for amd64 everything is
32# expected to pass).
33if [ -n "$CROSS" ]; then
34 CROSS_XFAIL=.gitlab-ci/cross-xfail-"$CROSS"
35 if [ -s "$CROSS_XFAIL" ]; then
36 sed -i \
37 -e '/\[properties\]/a\' \
38 -e "xfail = '$(tr '\n' , < $CROSS_XFAIL)'" \
39 "$CROSS_FILE"
40 fi
41fi
42
Michel Dänzer68977152019-05-03 10:58:48 +020043rm -rf _build
Michel Dänzercc2b3a92019-05-03 10:49:43 +020044meson _build --native-file=native.file \
Dylan Bakerc65f9072019-10-14 09:04:47 -070045 --wrap-mode=nofallback \
Adam Jackson6ec12592019-09-16 20:44:12 -040046 ${CROSS+--cross "$CROSS_FILE"} \
Eric Anholt96057492019-07-25 11:02:34 -070047 -D prefix=`pwd`/install \
Eric Anholtf68b9872019-07-23 11:12:07 -070048 -D libdir=lib \
Eric Anholtab498732019-08-01 12:14:15 -070049 -D buildtype=${BUILDTYPE:-debug} \
Michel Dänzercc2b3a92019-05-03 10:49:43 +020050 -D build-tests=true \
51 -D libunwind=${UNWIND} \
52 ${DRI_LOADERS} \
53 -D dri-drivers=${DRI_DRIVERS:-[]} \
54 ${GALLIUM_ST} \
55 -D gallium-drivers=${GALLIUM_DRIVERS:-[]} \
56 -D vulkan-drivers=${VULKAN_DRIVERS:-[]} \
Eric Engestrom5f8d29a2019-05-08 18:17:23 +020057 ${EXTRA_OPTION}
Michel Dänzercc2b3a92019-05-03 10:49:43 +020058cd _build
59meson configure
Eric Anholtc1e7e832020-02-11 15:44:56 -080060ninja
Michel Dänzercc2b3a92019-05-03 10:49:43 +020061LC_ALL=C.UTF-8 ninja test
Eric Anholt96057492019-07-25 11:02:34 -070062ninja install
Eric Anholtf60defa2019-04-10 15:59:12 -070063cd ..