aboutsummaryrefslogtreecommitdiffhomepage
path: root/BUILD
diff options
context:
space:
mode:
Diffstat (limited to 'BUILD')
-rw-r--r--BUILD45
1 files changed, 25 insertions, 20 deletions
diff --git a/BUILD b/BUILD
index d6fb85d8..c4b517cf 100644
--- a/BUILD
+++ b/BUILD
@@ -1,4 +1,4 @@
-# Bazel (http://bazel.io/) BUILD file for Protobuf.
+# Bazel (https://bazel.build/) BUILD file for Protobuf.
licenses(["notice"])
@@ -54,7 +54,19 @@ config_setting(
# Android and MSVC builds do not need to link in a separate pthread library.
LINK_OPTS = select({
":android": [],
- ":msvc": [],
+ ":msvc": [
+ # Linking to setargv.obj makes the default command line argument
+ # parser expand wildcards, so the main method's argv will contain the
+ # expanded list instead of the wildcards.
+ # Using -WHOLEARCHIVE, because:
+ # - Microsoft ships this object file next to default libraries
+ # - but this file is not a library, just a precompiled object
+ # - just listing the name here without "-WHOLEARCHIVE:" would make Bazel
+ # believe that "setargv.obj" is a source or rule output in this
+ # package, which it is not.
+ # See https://msdn.microsoft.com/en-us/library/8bch7bkk.aspx
+ "-WHOLEARCHIVE:setargv.obj",
+ ],
"//conditions:default": ["-lpthread", "-lm"],
})
@@ -257,24 +269,6 @@ internal_copied_filegroup(
# Protocol Buffers Compiler
################################################################################
-cc_binary(
- name = "js_embed",
- srcs = ["src/google/protobuf/compiler/js/embed.cc"],
- visibility = ["//visibility:public"],
-)
-
-genrule(
- name = "generate_js_well_known_types_embed",
- srcs = [
- "src/google/protobuf/compiler/js/well_known_types/any.js",
- "src/google/protobuf/compiler/js/well_known_types/struct.js",
- "src/google/protobuf/compiler/js/well_known_types/timestamp.js",
- ],
- outs = ["src/google/protobuf/compiler/js/well_known_types_embed.cc"],
- cmd = "$(location :js_embed) $(SRCS) > $@",
- tools = [":js_embed"],
-)
-
cc_library(
name = "protoc_lib",
srcs = [
@@ -628,6 +622,7 @@ py_library(
name = "python_srcs",
srcs = glob(
[
+ "python/google/__init__.py",
"python/google/protobuf/*.py",
"python/google/protobuf/**/*.py",
],
@@ -676,6 +671,7 @@ cc_binary(
linkstatic = 1,
deps = [
":protobuf",
+ ":proto_api",
] + select({
"//conditions:default": [],
":use_fast_cpp_protos": ["//external:python_headers"],
@@ -818,6 +814,15 @@ internal_protobuf_py_tests(
deps = [":python_tests"],
)
+cc_library(
+ name = "proto_api",
+ hdrs = ["python/google/protobuf/proto_api.h"],
+ deps = [
+ ":protobuf_python",
+ "//external:python_headers",
+ ],
+)
+
proto_lang_toolchain(
name = "cc_toolchain",
command_line = "--cpp_out=$(OUT)",