Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 568660415
  • Loading branch information
schmidt-sebastian authored and copybara-github committed Sep 26, 2023
1 parent 0417817 commit 3134625
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 16 deletions.
19 changes: 19 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,25 @@ http_archive(
],
)

# 2023-06-05
# This version of Glog is required for Windows support, but currently causes
# crashes on some Android devices.
http_archive(
name = "com_github_glog_glog_windows",
strip_prefix = "glog-3a0d4d22c5ae0b9a2216988411cfa6bf860cc372",
sha256 = "170d08f80210b82d95563f4723a15095eff1aad1863000e8eeb569c96a98fefb",
urls = [
"https://github.com/google/glog/archive/3a0d4d22c5ae0b9a2216988411cfa6bf860cc372.zip",
],
patches = [
"@//third_party:com_github_glog_glog.diff",
"@//third_party:com_github_glog_glog_windows_patch.diff",
],
patch_args = [
"-p1",
],
)

# easyexif
http_archive(
name = "easyexif",
Expand Down
2 changes: 1 addition & 1 deletion third_party/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ cc_library(
"@com_github_glog_glog//:glog",
],
"//mediapipe:windows": [
"@com_github_glog_glog//:glog",
"@com_github_glog_glog_windows//:glog",
],
"//conditions:default": [
"@com_github_glog_glog//:glog",
Expand Down
15 changes: 0 additions & 15 deletions third_party/com_github_glog_glog.diff
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,3 @@ index 4028ccc..483e639 100644
if (append_newline) {
// Fix the ostrstream back how it was before we screwed with it.
// It's 99.44% certain that we don't need to worry about doing this.

diff --git a/bazel/glog.bzl b/bazel/glog.bzl
index 4208d9e..3c86abf 100644
--- a/bazel/glog.bzl
+++ b/bazel/glog.bzl
@@ -180,6 +180,9 @@ def glog_library(namespace = "google", with_gflags = 1, **kwargs):
}),
copts =
select({
+ "@bazel_tools//src/conditions:windows": ["-std=c++17"],
+ "//conditions:default": [],
+ }) + select({
"@bazel_tools//src/conditions:windows": common_copts + windows_only_copts,
"@bazel_tools//src/conditions:darwin": common_copts + linux_or_darwin_copts + darwin_only_copts,
"@bazel_tools//src/conditions:freebsd": common_copts + linux_or_darwin_copts + freebsd_only_copts,
26 changes: 26 additions & 0 deletions third_party/com_github_glog_glog_windows_patch.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/bazel/glog.bzl b/bazel/glog.bzl
index dacd934..d7b3d78 100644
--- a/bazel/glog.bzl
+++ b/bazel/glog.bzl
@@ -53,7 +53,6 @@ def glog_library(namespace = "google", with_gflags = 1, **kwargs):
)

common_copts = [
- "-std=c++14",
"-DGLOG_BAZEL_BUILD",
# Inject a C++ namespace.
"-DGOOGLE_NAMESPACE='%s'" % namespace,
@@ -145,7 +144,13 @@ def glog_library(namespace = "google", with_gflags = 1, **kwargs):
],
})

+ c14_opts = ["-std=c++14"]
+ c17_opts = ["-std=c++17"]
+
final_lib_copts = select({
+ "@bazel_tools//src/conditions:windows": c17_opts,
+ "//conditions:default": c14_opts,
+ }) + select({
"@bazel_tools//src/conditions:windows": common_copts + windows_only_copts,
"@bazel_tools//src/conditions:darwin": common_copts + linux_or_darwin_copts + darwin_only_copts,
"@bazel_tools//src/conditions:freebsd": common_copts + linux_or_darwin_copts + freebsd_only_copts,

0 comments on commit 3134625

Please sign in to comment.