Skip to content

Commit

Permalink
Merge pull request protocolbuffers#2751 from keveman/master
Browse files Browse the repository at this point in the history
Added a header only cc_library target for the protobuf library.
  • Loading branch information
xfxyjwf authored Mar 6, 2017
2 parents 008ff03 + 6837b2d commit 0c0a887
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,17 @@ cc_library(
deps = [":protobuf_lite"],
)

# This provides just the header files for use in projects that need to build
# shared libraries for dynamic loading. This target is available until Bazel
# adds native support for such use cases.
# TODO(keveman): Remove this target once the support gets added to Bazel.
cc_library(
name = "protobuf_headers",
hdrs = glob(["src/**/*.h"]),
includes = ["src/"],
visibility = ["//visibility:public"],
)

objc_library(
name = "protobuf_objc",
hdrs = ["objectivec/GPBProtocolBuffers.h"],
Expand Down Expand Up @@ -565,12 +576,12 @@ java_library(
srcs = glob([
"java/util/src/main/java/com/google/protobuf/util/*.java",
]),
visibility = ["//visibility:public"],
deps = [
"protobuf_java",
"//external:gson",
"//external:guava",
],
visibility = ["//visibility:public"],
)

################################################################################
Expand All @@ -591,8 +602,8 @@ py_library(
"python/google/protobuf/internal/test_util.py",
],
),
srcs_version = "PY2AND3",
imports = ["python"],
srcs_version = "PY2AND3",
)

cc_binary(
Expand Down Expand Up @@ -657,8 +668,8 @@ config_setting(
internal_copied_filegroup(
name = "protos_python",
srcs = WELL_KNOWN_PROTOS,
strip_prefix = "src",
dest = "python",
strip_prefix = "src",
)

# TODO(dzc): Remove this once py_proto_library can have labels in srcs, in
Expand All @@ -680,7 +691,7 @@ py_proto_library(
protoc = ":protoc",
py_libs = [
":python_srcs",
"//external:six"
"//external:six",
],
srcs_version = "PY2AND3",
visibility = ["//visibility:public"],
Expand All @@ -694,13 +705,14 @@ py_proto_library(
internal_copied_filegroup(
name = "protos_python_test",
srcs = LITE_TEST_PROTOS + TEST_PROTOS,
strip_prefix = "src",
dest = "python",
strip_prefix = "src",
)

# TODO(dzc): Remove this once py_proto_library can have labels in srcs, in
# which case we can simply add :protos_python_test in srcs.
COPIED_LITE_TEST_PROTOS = ["python/" + s for s in RELATIVE_LITE_TEST_PROTOS]

COPIED_TEST_PROTOS = ["python/" + s for s in RELATIVE_TEST_PROTOS]

py_proto_library(
Expand Down Expand Up @@ -770,10 +782,10 @@ internal_protobuf_py_tests(
)

proto_lang_toolchain(
name = "cc_toolchain",
command_line = "--cpp_out=$(OUT)",
runtime = ":protobuf",
visibility = ["//visibility:public"],
name = "cc_toolchain",
command_line = "--cpp_out=$(OUT)",
runtime = ":protobuf",
visibility = ["//visibility:public"],
)

proto_lang_toolchain(
Expand Down

0 comments on commit 0c0a887

Please sign in to comment.