Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Originally added in D128465. Used by `llvm:Support` and `lld:ELF`. Enabled by default. Disable with `--@llvm_zstd//:llvm_enable_zstd=false`. Reviewed By: MaskRay, GMNGeoffrey Differential Revision: https://reviews.llvm.org/D143344
- Loading branch information
1 parent
5c2ae37
commit 75d2032
Showing
4 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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/zstd.h", | ||
"lib/zdict.h", | ||
"lib/zstd_errors.h", | ||
], | ||
"//conditions:default": [], | ||
}), | ||
defines = select({ | ||
":llvm_zstd_enabled": [ | ||
"LLVM_ENABLE_ZSTD=1", | ||
"ZSTD_MULTITHREAD", | ||
], | ||
"//conditions:default": [], | ||
}), | ||
strip_include_prefix = "lib", | ||
) |