Skip to content

Commit 1b902c5

Browse files
andylou2tfx-copybara
authored andcommitted
Add snappy dependency.
PiperOrigin-RevId: 303361782
1 parent 050ed19 commit 1b902c5

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

WORKSPACE

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,18 @@ http_archive(
4646
)
4747
# LINT.ThenChange(third_party/thrift.BUILD:thrift_gen_version)
4848

49+
# LINT.IfChange(snappy_archive_version)
50+
http_archive(
51+
name = "snappy",
52+
build_file = "//third_party:snappy.BUILD",
53+
sha256 = "16b677f07832a612b0836178db7f374e414f94657c138e6993cbfc5dcc58651f",
54+
strip_prefix = "snappy-1.1.8",
55+
urls = [
56+
"https://github.com/google/snappy/archive/1.1.8.tar.gz",
57+
],
58+
)
59+
# LINT.ThenChange(third_party/snappy.BUILD:snappy_gen_version)
60+
4961
# https://github.com/protocolbuffers/protobuf/tree/v3.8.0
5062
PROTOBUF_COMMIT="09745575a923640154bcf307fba8aedff47f240a"
5163

third_party/snappy.BUILD

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Description:
16+
# Snappy library
17+
18+
package(default_visibility = ["//visibility:public"])
19+
20+
licenses(["notice"]) # BSD 3-Clause
21+
22+
exports_files(["COPYING"])
23+
24+
cc_library(
25+
name = "snappy",
26+
srcs = glob(
27+
[
28+
"*.cc",
29+
"*.h",
30+
],
31+
exclude = [
32+
"*test.*",
33+
"*fuzzer.*",
34+
],
35+
),
36+
hdrs = [
37+
"snappy-stubs-public.h",
38+
],
39+
copts = [],
40+
includes = ["."],
41+
)
42+
43+
# LINT.IfChange(snappy_gen_version)
44+
genrule(
45+
name = "snappy_stubs_public_h",
46+
srcs = ["snappy-stubs-public.h.in"],
47+
outs = ["snappy-stubs-public.h"],
48+
cmd = ("sed " +
49+
"-e 's/$${HAVE_SYS_UIO_H_01}/HAVE_SYS_UIO_H/g' " +
50+
"-e 's/$${PROJECT_VERSION_MAJOR}/1/g' " +
51+
"-e 's/$${PROJECT_VERSION_MINOR}/1/g' " +
52+
"-e 's/$${PROJECT_VERSION_PATCH}/8/g' " +
53+
"$< >$@"),
54+
)
55+
# LINT.ThenChange(../WORKSPACE:snappy_archive_version)

0 commit comments

Comments
 (0)