Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

meson-build.sh 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #!/bin/bash
  2. set -e
  3. set -o xtrace
  4. CROSS_FILE=/cross_file-"$CROSS".txt
  5. # We need to control the version of llvm-config we're using, so we'll
  6. # tweak the cross file or generate a native file to do so.
  7. if test -n "$LLVM_VERSION"; then
  8. LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
  9. echo -e "[binaries]\nllvm-config = '`which $LLVM_CONFIG`'" > native.file
  10. if [ -n "$CROSS" ]; then
  11. sed -i -e '/\[binaries\]/a\' -e "llvm-config = '`which $LLVM_CONFIG`'" $CROSS_FILE
  12. fi
  13. $LLVM_CONFIG --version
  14. else
  15. rm -f native.file
  16. touch native.file
  17. fi
  18. # cross-xfail-$CROSS, if it exists, contains a list of tests that are expected
  19. # to fail for the $CROSS configuration, one per line. you can then mark those
  20. # tests in their meson.build with:
  21. #
  22. # test(...,
  23. # should_fail: meson.get_cross_property('xfail', '').contains(t),
  24. # )
  25. #
  26. # where t is the name of the test, and the '' is the string to search when
  27. # not cross-compiling (which is empty, because for amd64 everything is
  28. # expected to pass).
  29. if [ -n "$CROSS" ]; then
  30. CROSS_XFAIL=.gitlab-ci/cross-xfail-"$CROSS"
  31. if [ -s "$CROSS_XFAIL" ]; then
  32. sed -i \
  33. -e '/\[properties\]/a\' \
  34. -e "xfail = '$(tr '\n' , < $CROSS_XFAIL)'" \
  35. "$CROSS_FILE"
  36. fi
  37. fi
  38. rm -rf _build
  39. meson _build --native-file=native.file \
  40. --wrap-mode=nofallback \
  41. ${CROSS+--cross "$CROSS_FILE"} \
  42. -D prefix=`pwd`/install \
  43. -D libdir=lib \
  44. -D buildtype=${BUILDTYPE:-debug} \
  45. -D build-tests=true \
  46. -D libunwind=${UNWIND} \
  47. ${DRI_LOADERS} \
  48. -D dri-drivers=${DRI_DRIVERS:-[]} \
  49. ${GALLIUM_ST} \
  50. -D gallium-drivers=${GALLIUM_DRIVERS:-[]} \
  51. -D vulkan-drivers=${VULKAN_DRIVERS:-[]} \
  52. -D I-love-half-baked-turnips=true \
  53. ${EXTRA_OPTION}
  54. cd _build
  55. meson configure
  56. ninja -j4
  57. LC_ALL=C.UTF-8 ninja test
  58. ninja install
  59. cd ..
  60. if test -n "$MESON_SHADERDB"; then
  61. ./.gitlab-ci/run-shader-db.sh;
  62. fi
  63. # Delete 2MB of includes from artifacts.
  64. rm -rf install/include
  65. # Strip the drivers in the artifacts to cut 80% of the artifacts size.
  66. if [ -n "$CROSS" ]; then
  67. STRIP=`sed -n -E "s/strip\s*=\s*'(.*)'/\1/p" "$CROSS_FILE"`
  68. if [ -z "$STRIP" ]; then
  69. echo "Failed to find strip command in cross file"
  70. exit 1
  71. fi
  72. else
  73. STRIP="strip"
  74. fi
  75. find install -name \*.so -exec $STRIP {} \;
  76. # Test runs don't pull down the git tree, so put the dEQP helper
  77. # script and associated bits there.
  78. mkdir -p artifacts/
  79. cp -Rp .gitlab-ci/deqp* artifacts/
  80. # cp -Rp src/freedreno/ci/expected* artifacts/