From d392f8ad98b2d7375e3a57cd3464ecac7efef12a Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Mon, 31 Jul 2023 09:45:05 -0700 Subject: [PATCH] Ensure that -std=c++14/17 is the first argument passed to Glog PiperOrigin-RevId: 552509553 --- third_party/com_github_glog_glog.diff | 30 +++++++++++++-------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/third_party/com_github_glog_glog.diff b/third_party/com_github_glog_glog.diff index 9c6a443d4..15447d791 100644 --- a/third_party/com_github_glog_glog.diff +++ b/third_party/com_github_glog_glog.diff @@ -41,7 +41,7 @@ index 4028ccc..483e639 100644 // 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 dacd934..b56a6b9 100644 +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): @@ -52,19 +52,17 @@ index dacd934..b56a6b9 100644 "-DGLOG_BAZEL_BUILD", # Inject a C++ namespace. "-DGOOGLE_NAMESPACE='%s'" % namespace, -@@ -83,6 +82,7 @@ def glog_library(namespace = "google", with_gflags = 1, **kwargs): - ] +@@ -145,7 +144,13 @@ def glog_library(namespace = "google", with_gflags = 1, **kwargs): + ], + }) - linux_or_darwin_copts = wasm_copts + [ -+ "-std=c++14", - "-DGLOG_EXPORT=__attribute__((visibility(\\\"default\\\")))", - # For src/utilities.cc. - "-DHAVE_SYS_SYSCALL_H", -@@ -110,6 +110,7 @@ def glog_library(namespace = "google", with_gflags = 1, **kwargs): - ] - - windows_only_copts = [ -+ "-std=c++17", - # Override -DGLOG_EXPORT= from the cc_library's defines. - "-DGLOG_EXPORT=__declspec(dllexport)", - "-DGLOG_NO_ABBREVIATED_SEVERITIES", ++ 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,