1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
package(
default_visibility = ["//visibility:public"],
# BSD/MIT-like license (for zstd)
licenses = ["notice"],
)
bool_flag(
name = "llvm_enable_zstd",
build_setting_default = True,
)
config_setting(
name = "llvm_zstd_enabled",
flag_values = {":llvm_enable_zstd": "true"},
)
cc_library(
name = "zstd",
srcs = select({
":llvm_zstd_enabled": glob([
"lib/common/*.c",
"lib/common/*.h",
"lib/compress/*.c",
"lib/compress/*.h",
"lib/decompress/*.c",
"lib/decompress/*.h",
"lib/decompress/*.S",
"lib/dictBuilder/*.c",
"lib/dictBuilder/*.h",
]),
"//conditions:default": [],
}),
hdrs = select({
":llvm_zstd_enabled": [
"lib/zdict.h",
"lib/zstd.h",
"lib/zstd_errors.h",
],
"//conditions:default": [],
}),
defines = select({
":llvm_zstd_enabled": [
"LLVM_ENABLE_ZSTD=1",
"ZSTD_MULTITHREAD",
],
"//conditions:default": [],
}),
strip_include_prefix = "lib",
)
|