Skip to content

Commit d392f8a

Browse files
schmidt-sebastiancopybara-github
authored andcommitted
Ensure that -std=c++14/17 is the first argument passed to Glog
PiperOrigin-RevId: 552509553
1 parent 81cf7fa commit d392f8a

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

Diff for: third_party/com_github_glog_glog.diff

+14-16
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ index 4028ccc..483e639 100644
4141
// It's 99.44% certain that we don't need to worry about doing this.
4242

4343
diff --git a/bazel/glog.bzl b/bazel/glog.bzl
44-
index dacd934..b56a6b9 100644
44+
index dacd934..d7b3d78 100644
4545
--- a/bazel/glog.bzl
4646
+++ b/bazel/glog.bzl
4747
@@ -53,7 +53,6 @@ def glog_library(namespace = "google", with_gflags = 1, **kwargs):
@@ -52,19 +52,17 @@ index dacd934..b56a6b9 100644
5252
"-DGLOG_BAZEL_BUILD",
5353
# Inject a C++ namespace.
5454
"-DGOOGLE_NAMESPACE='%s'" % namespace,
55-
@@ -83,6 +82,7 @@ def glog_library(namespace = "google", with_gflags = 1, **kwargs):
56-
]
55+
@@ -145,7 +144,13 @@ def glog_library(namespace = "google", with_gflags = 1, **kwargs):
56+
],
57+
})
5758

58-
linux_or_darwin_copts = wasm_copts + [
59-
+ "-std=c++14",
60-
"-DGLOG_EXPORT=__attribute__((visibility(\\\"default\\\")))",
61-
# For src/utilities.cc.
62-
"-DHAVE_SYS_SYSCALL_H",
63-
@@ -110,6 +110,7 @@ def glog_library(namespace = "google", with_gflags = 1, **kwargs):
64-
]
65-
66-
windows_only_copts = [
67-
+ "-std=c++17",
68-
# Override -DGLOG_EXPORT= from the cc_library's defines.
69-
"-DGLOG_EXPORT=__declspec(dllexport)",
70-
"-DGLOG_NO_ABBREVIATED_SEVERITIES",
59+
+ c14_opts = ["-std=c++14"]
60+
+ c17_opts = ["-std=c++17"]
61+
+
62+
final_lib_copts = select({
63+
+ "@bazel_tools//src/conditions:windows": c17_opts,
64+
+ "//conditions:default": c14_opts,
65+
+ }) + select({
66+
"@bazel_tools//src/conditions:windows": common_copts + windows_only_copts,
67+
"@bazel_tools//src/conditions:darwin": common_copts + linux_or_darwin_copts + darwin_only_copts,
68+
"@bazel_tools//src/conditions:freebsd": common_copts + linux_or_darwin_copts + freebsd_only_copts,

0 commit comments

Comments
 (0)