Michel Dänzer | cc2b3a9 | 2019-05-03 10:49:43 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -e |
| 4 | set -o xtrace |
| 5 | |
Michel Dänzer | 59e7f14 | 2019-10-11 15:43:34 +0200 | [diff] [blame] | 6 | CROSS_FILE=/cross_file-"$CROSS".txt |
| 7 | |
Michel Dänzer | cc2b3a9 | 2019-05-03 10:49:43 +0200 | [diff] [blame] | 8 | # We need to control the version of llvm-config we're using, so we'll |
Michel Dänzer | 59e7f14 | 2019-10-11 15:43:34 +0200 | [diff] [blame] | 9 | # tweak the cross file or generate a native file to do so. |
Michel Dänzer | cc2b3a9 | 2019-05-03 10:49:43 +0200 | [diff] [blame] | 10 | if 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änzer | 59e7f14 | 2019-10-11 15:43:34 +0200 | [diff] [blame] | 13 | if [ -n "$CROSS" ]; then |
| 14 | sed -i -e '/\[binaries\]/a\' -e "llvm-config = '`which $LLVM_CONFIG`'" $CROSS_FILE |
| 15 | fi |
Michel Dänzer | cc2b3a9 | 2019-05-03 10:49:43 +0200 | [diff] [blame] | 16 | $LLVM_CONFIG --version |
| 17 | else |
Michel Dänzer | 6897715 | 2019-05-03 10:58:48 +0200 | [diff] [blame] | 18 | rm -f native.file |
Michel Dänzer | cc2b3a9 | 2019-05-03 10:49:43 +0200 | [diff] [blame] | 19 | touch native.file |
| 20 | fi |
| 21 | |
Adam Jackson | 6ec1259 | 2019-09-16 20:44:12 -0400 | [diff] [blame] | 22 | # 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). |
| 33 | if [ -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 |
| 41 | fi |
| 42 | |
Michel Dänzer | 6897715 | 2019-05-03 10:58:48 +0200 | [diff] [blame] | 43 | rm -rf _build |
Michel Dänzer | cc2b3a9 | 2019-05-03 10:49:43 +0200 | [diff] [blame] | 44 | meson _build --native-file=native.file \ |
Dylan Baker | c65f907 | 2019-10-14 09:04:47 -0700 | [diff] [blame] | 45 | --wrap-mode=nofallback \ |
Adam Jackson | 6ec1259 | 2019-09-16 20:44:12 -0400 | [diff] [blame] | 46 | ${CROSS+--cross "$CROSS_FILE"} \ |
Eric Anholt | 9605749 | 2019-07-25 11:02:34 -0700 | [diff] [blame] | 47 | -D prefix=`pwd`/install \ |
Eric Anholt | f68b987 | 2019-07-23 11:12:07 -0700 | [diff] [blame] | 48 | -D libdir=lib \ |
Eric Anholt | ab49873 | 2019-08-01 12:14:15 -0700 | [diff] [blame] | 49 | -D buildtype=${BUILDTYPE:-debug} \ |
Michel Dänzer | cc2b3a9 | 2019-05-03 10:49:43 +0200 | [diff] [blame] | 50 | -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 Engestrom | 5f8d29a | 2019-05-08 18:17:23 +0200 | [diff] [blame] | 57 | ${EXTRA_OPTION} |
Michel Dänzer | cc2b3a9 | 2019-05-03 10:49:43 +0200 | [diff] [blame] | 58 | cd _build |
| 59 | meson configure |
Eric Anholt | c1e7e83 | 2020-02-11 15:44:56 -0800 | [diff] [blame] | 60 | ninja |
Michel Dänzer | cc2b3a9 | 2019-05-03 10:49:43 +0200 | [diff] [blame] | 61 | LC_ALL=C.UTF-8 ninja test |
Eric Anholt | 9605749 | 2019-07-25 11:02:34 -0700 | [diff] [blame] | 62 | ninja install |
Eric Anholt | f60defa | 2019-04-10 15:59:12 -0700 | [diff] [blame] | 63 | cd .. |