aboutsummaryrefslogtreecommitdiffstats
path: root/build/platform/clang/clang-windows.sh
blob: 73552e62c827828d8083019a8c712bbd259621c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
set -euo pipefail

version="${1:-11.0.0}"
major="${version%%.*}"

arcadia="$(cd "$(dirname "${BASH_SOURCE[0]}")"/../../.. && pwd)"
tmp="${TMPDIR:-/tmp}/clang"
exe="LLVM-${version}-win64.exe"
dir="clang-${version}-win"
tar="${dir}.tar.gz"

set -x

mkdir -p "$tmp"
cd "$tmp"
test -e "$exe" || wget "https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/${exe}"

rm -rf "$dir"
mkdir -p "$dir"
cd "$dir"
7z x ../"$exe"

"$arcadia"/ya \
    make "$arcadia"/contrib/libs/llvm${major}/tools/{llvm-as,llvm-link,opt} \
    -DNO_DEBUGINFO -r --target-platform=windows --no-src-links -I bin

tar czf "../$tar" *

printf '%q ' ya upload "$tmp/$tar" -d "Clang $version for Windows" --ttl inf --owner BUILD_TOOLS --type CLANG_TOOLKIT --attr platform=win32 --attr "version=$version"
echo