llvm-project

Форк
0
131 строка · 4.4 Кб
1
# 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

5
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository")
6
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
7
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
8

9
SKYLIB_VERSION = "1.3.0"
10

11
http_archive(
12
    name = "bazel_skylib",
13
    sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
14
    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

20
new_local_repository(
21
    name = "llvm-raw",
22
    build_file_content = "# empty",
23
    path = "../../",
24
)
25

26
load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure")
27

28
llvm_configure(name = "llvm-project")
29

30
maybe(
31
    http_archive,
32
    name = "llvm_zlib",
33
    build_file = "@llvm-raw//utils/bazel/third_party_build:zlib-ng.BUILD",
34
    sha256 = "e36bb346c00472a1f9ff2a0a4643e590a254be6379da7cddd9daeb9a7f296731",
35
    strip_prefix = "zlib-ng-2.0.7",
36
    urls = [
37
        "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.7.zip",
38
    ],
39
)
40

41
maybe(
42
    http_archive,
43
    name = "vulkan_headers",
44
    build_file = "@llvm-raw//utils/bazel/third_party_build:vulkan_headers.BUILD",
45
    sha256 = "19f491784ef0bc73caff877d11c96a48b946b5a1c805079d9006e3fbaa5c1895",
46
    strip_prefix = "Vulkan-Headers-9bd3f561bcee3f01d22912de10bb07ce4e23d378",
47
    urls = [
48
        "https://github.com/KhronosGroup/Vulkan-Headers/archive/9bd3f561bcee3f01d22912de10bb07ce4e23d378.tar.gz",
49
    ],
50
)
51

52
load("@llvm-raw//utils/bazel:vulkan_sdk.bzl", "vulkan_sdk_setup")
53

54
maybe(
55
    vulkan_sdk_setup,
56
    name = "vulkan_sdk",
57
)
58

59
http_archive(
60
    name = "build_bazel_apple_support",
61
    sha256 = "c4bb2b7367c484382300aee75be598b92f847896fb31bbd22f3a2346adf66a80",
62
    url = "https://github.com/bazelbuild/apple_support/releases/download/1.15.1/apple_support.1.15.1.tar.gz",
63
)
64

65
load(
66
    "@build_bazel_apple_support//lib:repositories.bzl",
67
    "apple_support_dependencies",
68
)
69

70
apple_support_dependencies()
71

72
# llvm libc math tests reply on `mpfr`.
73
# The availability of `mpfr` is controlled by a flag and can be either `disable`, `system` or `external`.
74
# Continuous integration uses `system` to speed up the build process (see .bazelrc).
75
# Otherwise by default it is set to `external`: `mpfr` and `gmp` are built from source by using `rules_foreign_cc`.
76
# Note: that building from source requires `m4` to be installed on the host machine.
77
# This is a known issue: https://github.com/bazelbuild/rules_foreign_cc/issues/755.
78

79
git_repository(
80
    name = "rules_foreign_cc",
81
    remote = "https://github.com/bazelbuild/rules_foreign_cc.git",
82
    tag = "0.9.0",
83
)
84

85
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
86

87
rules_foreign_cc_dependencies()
88

89
maybe(
90
    http_archive,
91
    name = "gmp",
92
    build_file = "@llvm-raw//utils/bazel/third_party_build:gmp.BUILD",
93
    sha256 = "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2",
94
    strip_prefix = "gmp-6.2.1",
95
    urls = [
96
        "https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz",
97
        "https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz",
98
    ],
99
)
100

101
# https://www.mpfr.org/mpfr-current/
102
#
103
# When updating to a newer version, don't use URLs with "mpfr-current" in them.
104
# Instead, find a stable URL like the one used currently.
105
maybe(
106
    http_archive,
107
    name = "mpfr",
108
    build_file = "@llvm-raw//utils/bazel/third_party_build:mpfr.BUILD",
109
    sha256 = "9cbed5d0af0d9ed5e9f8dd013e17838eb15e1db9a6ae0d371d55d35f93a782a7",
110
    strip_prefix = "mpfr-4.1.1",
111
    urls = ["https://www.mpfr.org/mpfr-4.1.1/mpfr-4.1.1.tar.gz"],
112
)
113

114
maybe(
115
    new_git_repository,
116
    name = "pfm",
117
    build_file = "@llvm-raw//utils/bazel/third_party_build:pfm.BUILD",
118
    remote = "https://git.code.sf.net/p/perfmon2/libpfm4",
119
    tag = "v4.12.1",
120
)
121

122
maybe(
123
    http_archive,
124
    name = "llvm_zstd",
125
    build_file = "@llvm-raw//utils/bazel/third_party_build:zstd.BUILD",
126
    sha256 = "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0",
127
    strip_prefix = "zstd-1.5.2",
128
    urls = [
129
        "https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz",
130
    ],
131
)
132

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.