File tree Expand file tree Collapse file tree 4 files changed +70
-0
lines changed Expand file tree Collapse file tree 4 files changed +70
-0
lines changed Original file line number Diff line number Diff line change @@ -121,3 +121,14 @@ maybe(
121
121
remote = "https://git.code.sf.net/p/perfmon2/libpfm4" ,
122
122
tag = "v4.12.1" ,
123
123
)
124
+
125
+ maybe (
126
+ http_archive ,
127
+ name = "llvm_zstd" ,
128
+ build_file = "@llvm-raw//utils/bazel/third_party_build:zstd.BUILD" ,
129
+ sha256 = "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0" ,
130
+ strip_prefix = "zstd-1.5.2" ,
131
+ urls = [
132
+ "https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz"
133
+ ],
134
+ )
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ cc_library(
108
108
"//llvm:TargetParser" ,
109
109
"//llvm:TransformUtils" ,
110
110
"//llvm:config" ,
111
+ "@llvm_zstd//:zstd" ,
111
112
],
112
113
)
113
114
Original file line number Diff line number Diff line change @@ -283,6 +283,10 @@ cc_library(
283
283
# be an empty library unless zlib is enabled, in which case it will
284
284
# both provide the necessary dependencies and configuration defines.
285
285
"@llvm_zlib//:zlib" ,
286
+ # We unconditionally depend on the custom LLVM zstd wrapper. This will
287
+ # be an empty library unless zstd is enabled, in which case it will
288
+ # both provide the necessary dependencies and configuration defines.
289
+ "@llvm_zstd//:zstd" ,
286
290
],
287
291
)
288
292
Original file line number Diff line number Diff line change
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
+ load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
5
+
6
+ package(
7
+ default_visibility = ["//visibility:public"],
8
+ # BSD/MIT-like license (for zstd)
9
+ licenses = ["notice"],
10
+ )
11
+
12
+ bool_flag(
13
+ name = "llvm_enable_zstd",
14
+ build_setting_default = True,
15
+ )
16
+
17
+ config_setting(
18
+ name = "llvm_zstd_enabled",
19
+ flag_values = {":llvm_enable_zstd": "true"},
20
+ )
21
+
22
+ cc_library(
23
+ name = "zstd",
24
+ srcs = select({
25
+ ":llvm_zstd_enabled": glob([
26
+ "lib/common/*.c",
27
+ "lib/common/*.h",
28
+ "lib/compress/*.c",
29
+ "lib/compress/*.h",
30
+ "lib/decompress/*.c",
31
+ "lib/decompress/*.h",
32
+ "lib/decompress/*.S",
33
+ "lib/dictBuilder/*.c",
34
+ "lib/dictBuilder/*.h",
35
+ ]),
36
+ "//conditions:default": [],
37
+ }),
38
+ hdrs = select({
39
+ ":llvm_zstd_enabled": [
40
+ "lib/zstd.h",
41
+ "lib/zdict.h",
42
+ "lib/zstd_errors.h",
43
+ ],
44
+ "//conditions:default": [],
45
+ }),
46
+ defines = select({
47
+ ":llvm_zstd_enabled": [
48
+ "LLVM_ENABLE_ZSTD=1",
49
+ "ZSTD_MULTITHREAD",
50
+ ],
51
+ "//conditions:default": [],
52
+ }),
53
+ strip_include_prefix = "lib",
54
+ )
You can’t perform that action at this time.
0 commit comments