[DFAJumpThreading] Remove incoming StartBlock from all phis when unfolding select...
[llvm-project.git] / utils / bazel / third_party_build / zstd.BUILD
blob510c461390d8af76a5c498135aa21d30b0bace90
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")
6 package(
7     default_visibility = ["//visibility:public"],
8     # BSD/MIT-like license (for zstd)
9     licenses = ["notice"],
12 bool_flag(
13     name = "llvm_enable_zstd",
14     build_setting_default = True,
17 config_setting(
18     name = "llvm_zstd_enabled",
19     flag_values = {":llvm_enable_zstd": "true"},
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",