Project import generated by Copybara.

GitOrigin-RevId: afeb9cf5a8c069c0a566d16e1622bbb086170e4d
This commit is contained in:
MediaPipe Team
2020-05-21 13:37:51 -04:00
committed by chuoling
parent b6e680647c
commit b133b0f200
258 changed files with 4146 additions and 5147 deletions
+37
View File
@@ -19,6 +19,40 @@ exports_files(["LICENSE"])
package(default_visibility = ["//visibility:public"])
cc_library(
name = "glog",
visibility = ["//visibility:public"],
deps = select({
"//mediapipe:android_x86": [
"@com_github_glog_glog_v_0_3_5//:glog",
],
"//mediapipe:android_x86_64": [
"@com_github_glog_glog_v_0_3_5//:glog",
],
"//mediapipe:android_armeabi": [
"@com_github_glog_glog_v_0_3_5//:glog",
],
"//mediapipe:android_arm": [
"@com_github_glog_glog_v_0_3_5//:glog",
],
"//mediapipe:android_arm64": [
"@com_github_glog_glog_v_0_3_5//:glog",
],
"//mediapipe:ios": [
"@com_github_glog_glog_v_0_3_5//:glog",
],
"//mediapipe:macos": [
"@com_github_glog_glog//:glog",
],
"//mediapipe:windows": [
"@com_github_glog_glog//:glog",
],
"//conditions:default": [
"@com_github_glog_glog//:glog",
],
}),
)
cc_library(
name = "opencv",
visibility = ["//visibility:public"],
@@ -44,6 +78,9 @@ cc_library(
"//mediapipe:macos": [
"@macos_opencv//:opencv",
],
"//mediapipe:windows": [
"@windows_opencv//:opencv",
],
"//conditions:default": [
"@linux_opencv//:opencv",
],
@@ -1,8 +1,16 @@
diff --git a/bazel/ceres.bzl b/bazel/ceres.bzl
index d90e5a3..4420565 100644
index d90e5a3..32a3fef 100644
--- a/bazel/ceres.bzl
+++ b/bazel/ceres.bzl
@@ -202,6 +203,6 @@ def ceres_library(name,
@@ -180,7 +180,6 @@ def ceres_library(name,
]),
copts = [
"-I" + internal,
- "-Wno-sign-compare",
] + schur_eliminator_copts,
# These include directories and defines are propagated to other targets
@@ -202,7 +201,7 @@ def ceres_library(name,
],
visibility = ["//visibility:public"],
deps = [
+140
View File
@@ -0,0 +1,140 @@
diff --git a/BUILD b/BUILD
index 79871d621..51b3a063f 100644
--- a/BUILD
+++ b/BUILD
@@ -26,7 +26,7 @@ config_setting(
# ZLIB configuration
################################################################################
-ZLIB_DEPS = ["@zlib//:zlib"]
+ZLIB_DEPS = ["@zlib"]
################################################################################
# Protobuf Runtime Library
@@ -157,6 +157,7 @@ cc_library(
includes = ["src/"],
linkopts = LINK_OPTS,
visibility = ["//visibility:public"],
+ alwayslink = 1,
)
PROTOBUF_DEPS = select({
@@ -230,6 +231,7 @@ cc_library(
linkopts = LINK_OPTS,
visibility = ["//visibility:public"],
deps = [":protobuf_lite"] + PROTOBUF_DEPS,
+ alwayslink = 1,
)
# This provides just the header files for use in projects that need to build
@@ -318,13 +320,13 @@ cc_proto_library(
[native_cc_proto_library(
name = proto + "_cc_proto",
- deps = [proto + "_proto"],
visibility = ["//visibility:private"],
+ deps = [proto + "_proto"],
) for proto in WELL_KNOWN_PROTO_MAP.keys()]
cc_proto_blacklist_test(
name = "cc_proto_blacklist_test",
- deps = [proto + "_cc_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()]
+ deps = [proto + "_cc_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()],
)
################################################################################
@@ -900,7 +902,6 @@ py_proto_library(
py_extra_srcs = glob(["python/**/__init__.py"]),
py_libs = [
":python_srcs",
- "@six//:six",
],
srcs_version = "PY2AND3",
visibility = ["//visibility:public"],
@@ -1002,7 +1003,9 @@ cc_library(
# Note: We use `native_proto_common` here because we depend on an implementation-detail of
# `proto_lang_toolchain`, which may not be available on `proto_common`.
reject_blacklisted_files = hasattr(native_proto_common, "proto_lang_toolchain_rejects_files_do_not_use_or_we_will_break_you_without_mercy")
+
cc_toolchain_blacklisted_protos = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()] if reject_blacklisted_files else [":well_known_protos"]
+
proto_lang_toolchain(
name = "cc_toolchain",
blacklisted_protos = cc_toolchain_blacklisted_protos,
diff --git a/protobuf.bzl b/protobuf.bzl
index 829464d44..4ac23594b 100644
--- a/protobuf.bzl
+++ b/protobuf.bzl
@@ -87,6 +87,8 @@ def _proto_gen_impl(ctx):
for dep in ctx.attr.deps:
import_flags += dep.proto.import_flags
deps += dep.proto.deps
+ import_flags = depset(import_flags).to_list()
+ deps = depset(deps).to_list()
if not ctx.attr.gen_cc and not ctx.attr.gen_py and not ctx.executable.plugin:
return struct(
diff --git a/src/google/protobuf/io/gzip_stream.h b/src/google/protobuf/io/gzip_stream.h
index b1ce1d36c..d5d560ea7 100644
--- a/src/google/protobuf/io/gzip_stream.h
+++ b/src/google/protobuf/io/gzip_stream.h
@@ -47,10 +47,12 @@
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/port.h>
-#include <zlib.h>
-
#include <google/protobuf/port_def.inc>
+#if HAVE_ZLIB
+#include <zlib.h>
+#endif // HAVE_ZLIB
+
namespace google {
namespace protobuf {
namespace io {
@@ -76,8 +78,10 @@ class PROTOBUF_EXPORT GzipInputStream : public ZeroCopyInputStream {
virtual ~GzipInputStream();
// Return last error message or NULL if no error.
+#if HAVE_ZLIB
inline const char* ZlibErrorMessage() const { return zcontext_.msg; }
inline int ZlibErrorCode() const { return zerror_; }
+#endif // HAVE_ZLIB
// implements ZeroCopyInputStream ----------------------------------
bool Next(const void** data, int* size);
@@ -90,8 +94,10 @@ class PROTOBUF_EXPORT GzipInputStream : public ZeroCopyInputStream {
ZeroCopyInputStream* sub_stream_;
+ #if HAVE_ZLIB
z_stream zcontext_;
int zerror_;
+ #endif // HAVE_ZLIB
void* output_buffer_;
void* output_position_;
@@ -142,9 +148,11 @@ class PROTOBUF_EXPORT GzipOutputStream : public ZeroCopyOutputStream {
virtual ~GzipOutputStream();
+#if HAVE_ZLIB
// Return last error message or NULL if no error.
inline const char* ZlibErrorMessage() const { return zcontext_.msg; }
inline int ZlibErrorCode() const { return zerror_; }
+#endif // HAVE_ZLIB
// Flushes data written so far to zipped data in the underlying stream.
// It is the caller's responsibility to flush the underlying stream if
@@ -177,8 +185,10 @@ class PROTOBUF_EXPORT GzipOutputStream : public ZeroCopyOutputStream {
void* sub_data_;
int sub_data_size_;
+#if HAVE_ZLIB
z_stream zcontext_;
int zerror_;
+#endif //HAVE_ZLIB
void* input_buffer_;
size_t input_buffer_length_;
+1 -1
View File
@@ -26,7 +26,7 @@ cc_library(
],
),
hdrs = glob(["include/opencv2/**/*.h*"]),
includes = ["include"],
includes = ["include/"],
linkstatic = 1,
visibility = ["//visibility:public"],
)
+23
View File
@@ -0,0 +1,23 @@
# Description:
# OpenCV libraries for video/image processing on Windows
licenses(["notice"]) # BSD license
exports_files(["LICENSE"])
OPENCV_VERSION = "3410" # 3.4.10
# The following build rule assumes that the executable "opencv-3.4.10-vc14_vc15.exe"
# is downloaded and the files are extracted to local.
# If you install OpenCV separately, please modify the build rule accordingly.
cc_library(
name = "opencv",
srcs = [
"x64/vc15/lib/opencv_world" + OPENCV_VERSION + ".lib",
"x64/vc15/bin/opencv_world" + OPENCV_VERSION + ".dll",
],
hdrs = glob(["include/opencv2/**/*.h*"]),
includes = ["include/"],
linkstatic = 1,
visibility = ["//visibility:public"],
)
-90
View File
@@ -1,90 +0,0 @@
diff --git a/third_party/protobuf/protobuf.patch b/third_party/protobuf/protobuf.patch
index 8ce4a84375..d77e1f81f3 100644
--- a/third_party/protobuf/protobuf.patch
+++ b/third_party/protobuf/protobuf.patch
@@ -1,25 +1,25 @@
diff --git a/BUILD b/BUILD
-index dbae719ff..87dc38470 100644
+index 79871d621..096967b99 100644
--- a/BUILD
+++ b/BUILD
-@@ -23,7 +23,7 @@ config_setting(
+@@ -26,7 +26,7 @@ config_setting(
# ZLIB configuration
################################################################################
-
+
-ZLIB_DEPS = ["@zlib//:zlib"]
+ZLIB_DEPS = ["@zlib"]
-
+
################################################################################
# Protobuf Runtime Library
-@@ -143,6 +143,7 @@ cc_library(
+@@ -156,6 +156,7 @@ cc_library(
copts = COPTS,
includes = ["src/"],
linkopts = LINK_OPTS,
+ alwayslink = 1,
visibility = ["//visibility:public"],
)
-
-@@ -213,6 +214,7 @@ cc_library(
+
+@@ -228,6 +229,7 @@ cc_library(
copts = COPTS,
includes = ["src/"],
linkopts = LINK_OPTS,
@@ -27,17 +27,24 @@ index dbae719ff..87dc38470 100644
visibility = ["//visibility:public"],
deps = [":protobuf_lite"] + PROTOBUF_DEPS,
)
+@@ -900,7 +902,6 @@ py_proto_library(
+ py_extra_srcs = glob(["python/**/__init__.py"]),
+ py_libs = [
+ ":python_srcs",
+- "@six//:six",
+ ],
+ srcs_version = "PY2AND3",
+ visibility = ["//visibility:public"],
diff --git a/protobuf.bzl b/protobuf.bzl
-index e0653321f..253d9cbb5 100644
+index 829464d44..4ac23594b 100644
--- a/protobuf.bzl
+++ b/protobuf.bzl
-@@ -84,7 +84,9 @@ def _proto_gen_impl(ctx):
-
+@@ -87,6 +87,8 @@ def _proto_gen_impl(ctx):
for dep in ctx.attr.deps:
import_flags += dep.proto.import_flags
deps += dep.proto.deps
+ import_flags = depset(import_flags).to_list()
+ deps = depset(deps).to_list()
-
+
if not ctx.attr.gen_cc and not ctx.attr.gen_py and not ctx.executable.plugin:
- return struct(
+ return struct(
diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
index ead41e83c3..448fbee13f 100755
--- a/tensorflow/workspace.bzl
+++ b/tensorflow/workspace.bzl
@@ -476,14 +476,14 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
tf_http_archive(
name = "com_google_protobuf",
patch_file = clean_dep("//third_party/protobuf:protobuf.patch"),
- sha256 = "cfcba2df10feec52a84208693937c17a4b5df7775e1635c1e3baffc487b24c9b",
- strip_prefix = "protobuf-3.9.2",
+ sha256 = "a79d19dcdf9139fa4b81206e318e33d245c4c9da1ffed21c87288ed4380426f9",
+ strip_prefix = "protobuf-3.11.4",
system_build_file = clean_dep("//third_party/systemlibs:protobuf.BUILD"),
system_link_files = {
"//third_party/systemlibs:protobuf.bzl": "protobuf.bzl",
},
urls = [
- "https://storage.googleapis.com/mirror.tensorflow.org/github.com/protocolbuffers/protobuf/archive/v3.9.2.zip",
- "https://github.com/protocolbuffers/protobuf/archive/v3.9.2.zip",
+ "https://storage.googleapis.com/mirror.tensorflow.org/github.com/protocolbuffers/protobuf/archive/v3.11.4.tar.gz",
+ "https://github.com/protocolbuffers/protobuf/archive/v3.11.4.tar.gz",
],
)