Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
c4fb353f
Unverified
Commit
c4fb353f
authored
Dec 19, 2018
by
Adam Cozzette
Committed by
GitHub
Dec 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5479 from schroederc/cherry-pick-zlib
Cherry-pick zlib Bazel support
parents
81f6aa40
dd33adcb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
107 additions
and
3 deletions
+107
-3
BUILD
BUILD
+14
-2
Makefile.am
Makefile.am
+1
-0
WORKSPACE
WORKSPACE
+15
-1
WORKSPACE
examples/WORKSPACE
+15
-0
zlib.BUILD
examples/third_party/zlib.BUILD
+2
-0
zlib.BUILD
third_party/zlib.BUILD
+60
-0
No files found.
BUILD
View file @
c4fb353f
...
...
@@ -15,6 +15,12 @@ config_setting(
},
)
################################################################################
# ZLIB configuration
################################################################################
ZLIB_DEPS = ["//external:zlib"]
################################################################################
# Protobuf Runtime Library
################################################################################
...
...
@@ -42,6 +48,7 @@ COPTS = select({
":msvc" : MSVC_COPTS,
"//conditions:default": [
"-DHAVE_PTHREAD",
"-DHAVE_ZLIB",
"-Wall",
"-Woverloaded-virtual",
"-Wno-sign-compare",
...
...
@@ -117,6 +124,11 @@ cc_library(
visibility = ["//visibility:public"],
)
PROTOBUF_DEPS = select({
":msvc": [],
"//conditions:default": ZLIB_DEPS,
})
cc_library(
name = "protobuf",
srcs = [
...
...
@@ -182,7 +194,7 @@ cc_library(
includes = ["src/"],
linkopts = LINK_OPTS,
visibility = ["//visibility:public"],
deps = [":protobuf_lite"],
deps = [":protobuf_lite"]
+ PROTOBUF_DEPS
,
)
# This provides just the header files for use in projects that need to build
...
...
@@ -590,7 +602,7 @@ cc_test(
":protobuf",
":protoc_lib",
"//external:gtest_main",
],
]
+ PROTOBUF_DEPS
,
)
################################################################################
...
...
Makefile.am
View file @
c4fb353f
...
...
@@ -1103,6 +1103,7 @@ EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \
examples/list_people.py
\
examples/list_people_test.go
\
examples/pubspec.yaml
\
examples/third_party/zlib.BUILD
\
protobuf.bzl
\
python/release/wheel/build_wheel_manylinux.sh
\
python/release/wheel/Dockerfile
\
...
...
WORKSPACE
View file @
c4fb353f
workspace(name = "com_google_protobuf")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
new_local_repository(
name = "submodule_gmock",
build_file = "@//:third_party/googletest/BUILD.bazel",
path = "third_party/googletest",
build_file = "@//:third_party/googletest/BUILD.bazel"
)
http_archive(
...
...
@@ -21,6 +22,14 @@ http_archive(
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/2169ae1c374aab4a09aa90e65efe1a3aad4e279b.tar.gz"],
)
http_archive(
name = "net_zlib",
build_file = "//:third_party/zlib.BUILD",
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
strip_prefix = "zlib-1.2.11",
urls = ["https://zlib.net/zlib-1.2.11.tar.gz"],
)
bind(
name = "python_headers",
actual = "//util/python:python_headers",
...
...
@@ -60,3 +69,8 @@ bind(
name = "gson",
actual = "@gson_maven//jar",
)
bind(
name = "zlib",
actual = "@net_zlib//:zlib",
)
examples/WORKSPACE
View file @
c4fb353f
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# This com_google_protobuf repository is required for proto_library rule.
# It provides the protocol compiler binary (i.e., protoc).
http_archive(
...
...
@@ -39,5 +41,18 @@ http_archive(
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/2169ae1c374aab4a09aa90e65efe1a3aad4e279b.tar.gz"],
)
http_archive(
name = "net_zlib",
build_file = "//:third_party/zlib.BUILD",
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
strip_prefix = "zlib-1.2.11",
urls = ["https://zlib.net/zlib-1.2.11.tar.gz"],
)
bind(
name = "zlib",
actual = "@net_zlib//:zlib",
)
load("@bazel_skylib//lib:versions.bzl", "versions")
versions.check(minimum_bazel_version = "0.5.4")
examples/third_party/zlib.BUILD
0 → 120000
View file @
c4fb353f
../../third_party/zlib.BUILD
\ No newline at end of file
third_party/zlib.BUILD
0 → 100644
View file @
c4fb353f
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # BSD/MIT-like license (for zlib)
_ZLIB_HEADERS = [
"crc32.h",
"deflate.h",
"gzguts.h",
"inffast.h",
"inffixed.h",
"inflate.h",
"inftrees.h",
"trees.h",
"zconf.h",
"zlib.h",
"zutil.h",
]
_ZLIB_PREFIXED_HEADERS = ["zlib/include/" + hdr for hdr in _ZLIB_HEADERS]
# In order to limit the damage from the `includes` propagation
# via `:zlib`, copy the public headers to a subdirectory and
# expose those.
genrule(
name = "copy_public_headers",
srcs = _ZLIB_HEADERS,
outs = _ZLIB_PREFIXED_HEADERS,
cmd = "cp $(SRCS) $(@D)/zlib/include/",
visibility = ["//visibility:private"],
)
cc_library(
name = "zlib",
srcs = [
"adler32.c",
"compress.c",
"crc32.c",
"deflate.c",
"gzclose.c",
"gzlib.c",
"gzread.c",
"gzwrite.c",
"infback.c",
"inffast.c",
"inflate.c",
"inftrees.c",
"trees.c",
"uncompr.c",
"zutil.c",
# Include the un-prefixed headers in srcs to work
# around the fact that zlib isn't consistent in its
# choice of <> or "" delimiter when including itself.
] + _ZLIB_HEADERS,
hdrs = _ZLIB_PREFIXED_HEADERS,
copts = [
"-Wno-unused-variable",
"-Wno-implicit-function-declaration",
],
includes = ["zlib/include/"],
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment