12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- # Copyright Materialize, Inc. and contributors. All rights reserved.
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License in the LICENSE file at the
- # root of this repository, or online at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- """Builds zstd."""
- filegroup(
- name = "common_sources",
- srcs = glob([
- "lib/common/*.c",
- "lib/common/*.h",
- ]),
- )
- filegroup(
- name = "compress_sources",
- srcs = glob([
- "lib/compress/*.c",
- "lib/compress/*.h",
- ]),
- )
- filegroup(
- name = "decompress_sources",
- srcs = glob([
- "lib/decompress/*.c",
- "lib/decompress/*.h",
- # Decompress includes an optimized assembly implementation.
- "lib/decompress/*.S",
- ]),
- )
- filegroup(
- name = "dict_builder_sources",
- srcs = glob([
- "lib/dictBuilder/*.c",
- "lib/dictBuilder/*.h",
- ]),
- )
- filegroup(
- name = "legacy_sources",
- srcs = glob([
- "lib/legacy/*.c",
- "lib/legacy/*.h",
- ]),
- )
- cc_library(
- name = "zstd",
- srcs = [
- ":common_sources",
- ":compress_sources",
- ":decompress_sources",
- ":dict_builder_sources",
- ":legacy_sources",
- ],
- hdrs = [
- "lib/zdict.h",
- "lib/zstd.h",
- "lib/zstd_errors.h",
- ],
- copts = ["-pthread"],
- includes = ["lib"],
- linkstatic = True,
- local_defines = [
- "ZSTD_LIB_COMPRESSION=1",
- "ZSTD_LIB_DECOMPRESSION=1",
- "ZSTD_LIB_DICTBUILDER=1",
- "ZSTD_LIB_DEPRECATED=0",
- "ZSTD_MULTITHREAD",
- "ZSTD_BUILD_SHARED=off",
- "ZSTD_BUILD_STATIC=on",
- "ZSTD_LEGACY_SUPPORT=1",
- ],
- visibility = ["//visibility:public"],
- )
|