Skip to content

Commit

Permalink
Merge pull request #1166 from antmicro:49966-zstd-cleaned
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 585121246
  • Loading branch information
copybara-github committed Nov 24, 2023
2 parents e6f243e + 75a6a22 commit 75dbac2
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 0 deletions.
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ build --host_copt "-Wno-comment"
# https://github.com/google/googletest/issues/4383
build --define absl=1
build --incompatible_enable_cc_toolchain_resolution
build --@llvm_zstd//:llvm_enable_zstd=false

# Settings for --config=asan address sanitizer build
build:asan --strip=never
Expand Down
15 changes: 15 additions & 0 deletions dependency_support/com_github_facebook_zstd/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2023 The XLS Authors
#
# 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 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.

# Needed to make this a package.
50 changes: 50 additions & 0 deletions dependency_support/com_github_facebook_zstd/bundled.BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Copyright 2023 The XLS Authors
#
# 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 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.

package(default_visibility = ["//visibility:public"])

licenses(["notice"])

# Builds everything together similarly to the zstd cmake file:
# https://github.com/facebook/zstd/blob/dev/build/cmake/lib/CMakeLists.txt
# but with legacy support and defines as in the zstd BUCK file:
# https://github.com/facebook/zstd/blob/dev/lib/BUCK

cc_library(
name = "zstd",
srcs = glob([
"lib/common/*.h",
"lib/common/*.c",
"lib/compress/*.h",
"lib/compress/*.c",
"lib/decompress/*.h",
"lib/decompress/*.c",
"lib/decompress/*.S",
"lib/deprecated/*.h",
"lib/deprecated/*.c",
"lib/dictBuilder/*.h",
"lib/dictBuilder/*.c",
"lib/legacy/*.h",
"lib/legacy/*.c",
]),
hdrs = [
"lib/zstd.h",
],
strip_include_prefix = "lib",
local_defines = [
"ZSTD_LEGACY_SUPPORT=4",
"XXH_NAMESPACE=ZSTD_",
],
visibility = ["//visibility:public"],
)
11 changes: 11 additions & 0 deletions dependency_support/load_external.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,14 @@ def load_external_repositories():
"https://github.com/nlohmann/json/archive/refs/tags/v3.10.2.tar.gz",
],
)

# Version 1.4.7 released on 17.12.2020
# https://github.com/facebook/zstd/releases/tag/v1.4.7
# Updated 23.11.2023
http_archive(
name = "com_github_facebook_zstd",
sha256 = "192cbb1274a9672cbcceaf47b5c4e9e59691ca60a357f1d4a8b2dfa2c365d757",
strip_prefix = "zstd-1.4.7",
urls = ["https://github.com/facebook/zstd/releases/download/v1.4.7/zstd-1.4.7.tar.gz"],
build_file = "@//dependency_support/com_github_facebook_zstd:bundled.BUILD.bazel",
)

0 comments on commit 75dbac2

Please sign in to comment.