clang-windows.sh 813 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. version="${1:-11.0.0}"
  4. major="${version%%.*}"
  5. arcadia="$(cd "$(dirname "${BASH_SOURCE[0]}")"/../../.. && pwd)"
  6. tmp="${TMPDIR:-/tmp}/clang"
  7. exe="LLVM-${version}-win64.exe"
  8. dir="clang-${version}-win"
  9. tar="${dir}.tar.gz"
  10. set -x
  11. mkdir -p "$tmp"
  12. cd "$tmp"
  13. test -e "$exe" || wget "https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/${exe}"
  14. rm -rf "$dir"
  15. mkdir -p "$dir"
  16. cd "$dir"
  17. 7z x ../"$exe"
  18. "$arcadia"/ya \
  19. make "$arcadia"/contrib/libs/llvm${major}/tools/{llvm-as,llvm-link,opt} \
  20. -DNO_DEBUGINFO -r --target-platform=windows --no-src-links -I bin
  21. tar czf "../$tar" *
  22. 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"
  23. echo