Geoffrey Martin-Noble | 4aeb2e6 | 2021-05-18 22:42:25 | [diff] [blame] | 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 | |
Geoffrey Martin-Noble | 4aeb2e6 | 2021-05-18 22:42:25 | [diff] [blame] | 5 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 6 | load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") |
Jordan Rupprecht | 4aa7769 | 2022-12-28 16:13:20 | [diff] [blame] | 7 | load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository") |
Geoffrey Martin-Noble | 4aeb2e6 | 2021-05-18 22:42:25 | [diff] [blame] | 8 | |
Christian Sigg | 7876469 | 2022-09-21 13:22:58 | [diff] [blame] | 9 | SKYLIB_VERSION = "1.3.0" |
Geoffrey Martin-Noble | 8b86b3a | 2021-07-16 18:49:50 | [diff] [blame] | 10 | |
| 11 | http_archive( |
| 12 | name = "bazel_skylib", |
Christian Sigg | 7876469 | 2022-09-21 13:22:58 | [diff] [blame] | 13 | sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506", |
Geoffrey Martin-Noble | 8b86b3a | 2021-07-16 18:49:50 | [diff] [blame] | 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 | |
Christian Sigg | 81d5412 | 2021-08-18 07:14:42 | [diff] [blame] | 20 | new_local_repository( |
| 21 | name = "llvm-raw", |
Christian Sigg | 81d5412 | 2021-08-18 07:14:42 | [diff] [blame] | 22 | build_file_content = "# empty", |
Jordan Rupprecht | 4aa7769 | 2022-12-28 16:13:20 | [diff] [blame] | 23 | path = "../../", |
Geoffrey Martin-Noble | 4aeb2e6 | 2021-05-18 22:42:25 | [diff] [blame] | 24 | ) |
| 25 | |
Christian Sigg | 81d5412 | 2021-08-18 07:14:42 | [diff] [blame] | 26 | load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure") |
| 27 | |
| 28 | llvm_configure(name = "llvm-project") |
| 29 | |
| 30 | load("@llvm-raw//utils/bazel:terminfo.bzl", "llvm_terminfo_from_env") |
Geoffrey Martin-Noble | 4aeb2e6 | 2021-05-18 22:42:25 | [diff] [blame] | 31 | |
| 32 | maybe( |
| 33 | llvm_terminfo_from_env, |
| 34 | name = "llvm_terminfo", |
| 35 | ) |
| 36 | |
| 37 | maybe( |
| 38 | http_archive, |
Geoffrey Martin-Noble | 4aeb2e6 | 2021-05-18 22:42:25 | [diff] [blame] | 39 | name = "llvm_zlib", |
Aaron Siddhartha Mondal | a268127 | 2023-05-19 21:03:46 | [diff] [blame^] | 40 | 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-Noble | 4aeb2e6 | 2021-05-18 22:42:25 | [diff] [blame] | 46 | ) |
| 47 | |
| 48 | maybe( |
| 49 | http_archive, |
| 50 | name = "vulkan_headers", |
Christian Sigg | 81d5412 | 2021-08-18 07:14:42 | [diff] [blame] | 51 | build_file = "@llvm-raw//utils/bazel/third_party_build:vulkan_headers.BUILD", |
Geoffrey Martin-Noble | 4aeb2e6 | 2021-05-18 22:42:25 | [diff] [blame] | 52 | 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 Sigg | 81d5412 | 2021-08-18 07:14:42 | [diff] [blame] | 59 | load("@llvm-raw//utils/bazel:vulkan_sdk.bzl", "vulkan_sdk_setup") |
Geoffrey Martin-Noble | 4aeb2e6 | 2021-05-18 22:42:25 | [diff] [blame] | 60 | |
| 61 | maybe( |
| 62 | vulkan_sdk_setup, |
| 63 | name = "vulkan_sdk", |
| 64 | ) |
| 65 | |
Guillaume Chatelet | d856e5f | 2022-11-18 10:14:37 | [diff] [blame] | 66 | # 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 | |
| 73 | git_repository( |
| 74 | name = "rules_foreign_cc", |
Jordan Rupprecht | 4aa7769 | 2022-12-28 16:13:20 | [diff] [blame] | 75 | remote = "https://github.com/bazelbuild/rules_foreign_cc.git", |
Guillaume Chatelet | d856e5f | 2022-11-18 10:14:37 | [diff] [blame] | 76 | tag = "0.9.0", |
Guillaume Chatelet | d856e5f | 2022-11-18 10:14:37 | [diff] [blame] | 77 | ) |
| 78 | |
| 79 | load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") |
Jordan Rupprecht | 4aa7769 | 2022-12-28 16:13:20 | [diff] [blame] | 80 | |
Guillaume Chatelet | d856e5f | 2022-11-18 10:14:37 | [diff] [blame] | 81 | rules_foreign_cc_dependencies() |
| 82 | |
| 83 | maybe( |
| 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 Chatelet | e7fb6c3 | 2022-11-21 09:38:42 | [diff] [blame] | 95 | # https://www.mpfr.org/mpfr-current/ |
Dmitri Gribenko | dd9298b | 2023-01-09 09:26:25 | [diff] [blame] | 96 | # |
| 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 Chatelet | d856e5f | 2022-11-18 10:14:37 | [diff] [blame] | 99 | maybe( |
| 100 | http_archive, |
| 101 | name = "mpfr", |
| 102 | build_file = "@llvm-raw//utils/bazel/third_party_build:mpfr.BUILD", |
Guillaume Chatelet | e7fb6c3 | 2022-11-21 09:38:42 | [diff] [blame] | 103 | sha256 = "9cbed5d0af0d9ed5e9f8dd013e17838eb15e1db9a6ae0d371d55d35f93a782a7", |
| 104 | strip_prefix = "mpfr-4.1.1", |
Dmitri Gribenko | dd9298b | 2023-01-09 09:26:25 | [diff] [blame] | 105 | urls = ["https://www.mpfr.org/mpfr-4.1.1/mpfr-4.1.1.tar.gz"], |
Guillaume Chatelet | d856e5f | 2022-11-18 10:14:37 | [diff] [blame] | 106 | ) |
| 107 | |
Jordan Rupprecht | 4aa7769 | 2022-12-28 16:13:20 | [diff] [blame] | 108 | maybe( |
| 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 Mondal | 75d2032 | 2023-03-28 23:29:05 | [diff] [blame] | 115 | |
| 116 | maybe( |
| 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 | ) |