blob: ab4b87ff8b1398135fb9cdc365ac2d1e6a1953f6 [file] [log] [blame]
Geoffrey Martin-Noble4aeb2e62021-05-18 22:42:251# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2# See https://llvm.org/LICENSE.txt for license information.
3# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
Geoffrey Martin-Noble4aeb2e62021-05-18 22:42:255load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
6load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
Jordan Rupprecht4aa77692022-12-28 16:13:207load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository")
Geoffrey Martin-Noble4aeb2e62021-05-18 22:42:258
Christian Sigg78764692022-09-21 13:22:589SKYLIB_VERSION = "1.3.0"
Geoffrey Martin-Noble8b86b3a2021-07-16 18:49:5010
11http_archive(
12 name = "bazel_skylib",
Christian Sigg78764692022-09-21 13:22:5813 sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
Geoffrey Martin-Noble8b86b3a2021-07-16 18:49:5014 urls = [
15 "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version=SKYLIB_VERSION),
16 "https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version=SKYLIB_VERSION),
17 ],
18)
19
Christian Sigg81d54122021-08-18 07:14:4220new_local_repository(
21 name = "llvm-raw",
Christian Sigg81d54122021-08-18 07:14:4222 build_file_content = "# empty",
Jordan Rupprecht4aa77692022-12-28 16:13:2023 path = "../../",
Geoffrey Martin-Noble4aeb2e62021-05-18 22:42:2524)
25
Christian Sigg81d54122021-08-18 07:14:4226load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure")
27
28llvm_configure(name = "llvm-project")
29
30load("@llvm-raw//utils/bazel:terminfo.bzl", "llvm_terminfo_from_env")
Geoffrey Martin-Noble4aeb2e62021-05-18 22:42:2531
32maybe(
33 llvm_terminfo_from_env,
34 name = "llvm_terminfo",
35)
36
37maybe(
38 http_archive,
Geoffrey Martin-Noble4aeb2e62021-05-18 22:42:2539 name = "llvm_zlib",
Aaron Siddhartha Mondala2681272023-05-19 21:03:4640 build_file = "@llvm-raw//utils/bazel/third_party_build:zlib-ng.BUILD",
41 sha256 = "e36bb346c00472a1f9ff2a0a4643e590a254be6379da7cddd9daeb9a7f296731",
42 strip_prefix = "zlib-ng-2.0.7",
43 urls = [
44 "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.7.zip",
45 ],
Geoffrey Martin-Noble4aeb2e62021-05-18 22:42:2546)
47
48maybe(
49 http_archive,
50 name = "vulkan_headers",
Christian Sigg81d54122021-08-18 07:14:4251 build_file = "@llvm-raw//utils/bazel/third_party_build:vulkan_headers.BUILD",
Geoffrey Martin-Noble4aeb2e62021-05-18 22:42:2552 sha256 = "19f491784ef0bc73caff877d11c96a48b946b5a1c805079d9006e3fbaa5c1895",
53 strip_prefix = "Vulkan-Headers-9bd3f561bcee3f01d22912de10bb07ce4e23d378",
54 urls = [
55 "https://github.com/KhronosGroup/Vulkan-Headers/archive/9bd3f561bcee3f01d22912de10bb07ce4e23d378.tar.gz",
56 ],
57)
58
Christian Sigg81d54122021-08-18 07:14:4259load("@llvm-raw//utils/bazel:vulkan_sdk.bzl", "vulkan_sdk_setup")
Geoffrey Martin-Noble4aeb2e62021-05-18 22:42:2560
61maybe(
62 vulkan_sdk_setup,
63 name = "vulkan_sdk",
64)
65
Guillaume Chateletd856e5f2022-11-18 10:14:3766# llvm libc math tests reply on `mpfr`.
67# The availability of `mpfr` is controlled by a flag and can be either `disable`, `system` or `external`.
68# Continuous integration uses `system` to speed up the build process (see .bazelrc).
69# Otherwise by default it is set to `external`: `mpfr` and `gmp` are built from source by using `rules_foreign_cc`.
70# Note: that building from source requires `m4` to be installed on the host machine.
71# This is a known issue: https://github.com/bazelbuild/rules_foreign_cc/issues/755.
72
73git_repository(
74 name = "rules_foreign_cc",
Jordan Rupprecht4aa77692022-12-28 16:13:2075 remote = "https://github.com/bazelbuild/rules_foreign_cc.git",
Guillaume Chateletd856e5f2022-11-18 10:14:3776 tag = "0.9.0",
Guillaume Chateletd856e5f2022-11-18 10:14:3777)
78
79load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
Jordan Rupprecht4aa77692022-12-28 16:13:2080
Guillaume Chateletd856e5f2022-11-18 10:14:3781rules_foreign_cc_dependencies()
82
83maybe(
84 http_archive,
85 name = "gmp",
86 build_file = "@llvm-raw//utils/bazel/third_party_build:gmp.BUILD",
87 sha256 = "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2",
88 strip_prefix = "gmp-6.2.1",
89 urls = [
90 "https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz",
91 "https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz",
92 ],
93)
94
Guillaume Chatelete7fb6c32022-11-21 09:38:4295# https://www.mpfr.org/mpfr-current/
Dmitri Gribenkodd9298b2023-01-09 09:26:2596#
97# When updating to a newer version, don't use URLs with "mpfr-current" in them.
98# Instead, find a stable URL like the one used currently.
Guillaume Chateletd856e5f2022-11-18 10:14:3799maybe(
100 http_archive,
101 name = "mpfr",
102 build_file = "@llvm-raw//utils/bazel/third_party_build:mpfr.BUILD",
Guillaume Chatelete7fb6c32022-11-21 09:38:42103 sha256 = "9cbed5d0af0d9ed5e9f8dd013e17838eb15e1db9a6ae0d371d55d35f93a782a7",
104 strip_prefix = "mpfr-4.1.1",
Dmitri Gribenkodd9298b2023-01-09 09:26:25105 urls = ["https://www.mpfr.org/mpfr-4.1.1/mpfr-4.1.1.tar.gz"],
Guillaume Chateletd856e5f2022-11-18 10:14:37106)
107
Jordan Rupprecht4aa77692022-12-28 16:13:20108maybe(
109 new_git_repository,
110 name = "pfm",
111 build_file = "@llvm-raw//utils/bazel/third_party_build:pfm.BUILD",
112 remote = "https://git.code.sf.net/p/perfmon2/libpfm4",
113 tag = "v4.12.1",
114)
Aaron Siddhartha Mondal75d20322023-03-28 23:29:05115
116maybe(
117 http_archive,
118 name = "llvm_zstd",
119 build_file = "@llvm-raw//utils/bazel/third_party_build:zstd.BUILD",
120 sha256 = "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0",
121 strip_prefix = "zstd-1.5.2",
122 urls = [
123 "https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz"
124 ],
125)