1#!/bin/bash 2 3set -ex 4 5export LLVM_CONFIG="llvm-config-11" 6 7$LLVM_CONFIG --version 8 9git config --global user.email "mesa@example.com" 10git config --global user.name "Mesa CI" 11git clone \ 12 https://github.com/llvm/llvm-project \ 13 --depth 1 \ 14 -b llvmorg-12.0.0-rc3 \ 15 /llvm-project 16 17mkdir /libclc 18pushd /libclc 19cmake -S /llvm-project/libclc -B . -G Ninja -DLLVM_CONFIG=$LLVM_CONFIG -DLIBCLC_TARGETS_TO_BUILD="spirv-mesa3d-;spirv64-mesa3d-" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DLLVM_SPIRV=/usr/bin/llvm-spirv 20ninja 21ninja install 22popd 23 24# workaroud cmake vs debian packaging. 25mkdir -p /usr/lib/clc 26ln -s /usr/share/clc/spirv64-mesa3d-.spv /usr/lib/clc/ 27ln -s /usr/share/clc/spirv-mesa3d-.spv /usr/lib/clc/ 28 29du -sh * 30rm -rf /libclc /llvm-project 31