aboutsummaryrefslogtreecommitdiff
path: root/BUILD
diff options
context:
space:
mode:
Diffstat (limited to 'BUILD')
-rw-r--r--BUILD52
1 files changed, 40 insertions, 12 deletions
diff --git a/BUILD b/BUILD
index 0941d8c4..913cc364 100644
--- a/BUILD
+++ b/BUILD
@@ -2,6 +2,8 @@
licenses(["notice"])
+exports_files(["LICENSE"])
+
################################################################################
# Protobuf Runtime Library
################################################################################
@@ -12,7 +14,7 @@ COPTS = [
"-Wwrite-strings",
"-Woverloaded-virtual",
"-Wno-sign-compare",
- "-Wno-error=unused-function",
+ "-Wno-unused-function",
]
config_setting(
@@ -25,11 +27,11 @@ config_setting(
# Android builds do not need to link in a separate pthread library.
LINK_OPTS = select({
":android": [],
- "//conditions:default": ["-lpthread"],
+ "//conditions:default": ["-lpthread", "-lm"],
})
load(
- "protobuf",
+ ":protobuf.bzl",
"cc_proto_library",
"py_proto_library",
"internal_copied_filegroup",
@@ -179,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"],
@@ -541,12 +554,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"],
)
################################################################################
@@ -567,12 +580,12 @@ py_library(
"python/google/protobuf/internal/test_util.py",
],
),
- srcs_version = "PY2AND3",
imports = ["python"],
+ srcs_version = "PY2AND3",
)
cc_binary(
- name = "internal/_api_implementation.so",
+ name = "python/google/protobuf/internal/_api_implementation.so",
srcs = ["python/google/protobuf/internal/api_implementation.cc"],
copts = COPTS + [
"-DPYTHON_PROTO2_CPP_IMPL_V2",
@@ -586,7 +599,7 @@ cc_binary(
)
cc_binary(
- name = "pyext/_message.so",
+ name = "python/google/protobuf/pyext/_message.so",
srcs = glob([
"python/google/protobuf/pyext/*.cc",
"python/google/protobuf/pyext/*.h",
@@ -633,8 +646,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
@@ -648,15 +661,15 @@ py_proto_library(
data = select({
"//conditions:default": [],
":use_fast_cpp_protos": [
- ":internal/_api_implementation.so",
- ":pyext/_message.so",
+ ":python/google/protobuf/internal/_api_implementation.so",
+ ":python/google/protobuf/pyext/_message.so",
],
}),
default_runtime = "",
protoc = ":protoc",
py_libs = [
":python_srcs",
- "//external:six"
+ "//external:six",
],
srcs_version = "PY2AND3",
visibility = ["//visibility:public"],
@@ -670,13 +683,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(
@@ -744,3 +758,17 @@ internal_protobuf_py_tests(
],
deps = [":python_tests"],
)
+
+proto_lang_toolchain(
+ name = "cc_toolchain",
+ command_line = "--cpp_out=$(OUT)",
+ runtime = ":protobuf",
+ visibility = ["//visibility:public"],
+)
+
+proto_lang_toolchain(
+ name = "java_toolchain",
+ command_line = "--java_out=$(OUT)",
+ runtime = ":protobuf_java",
+ visibility = ["//visibility:public"],
+)