Commit 3a2a481f authored by Mirko Bonadei's avatar Mirko Bonadei Committed by Commit Bot

Add gtest absl deps to the absl component.

This CL conditionally adds absl/debugging deps to the absl component
if build_with_chromium=false. This will allow downstream projects to
use gtest with absl (for pretty printers and matchers) but it will
remove these dependencies in Chromium to avoid to add static
initializers.

When static initializers will be removed, the dependency will not be
conditional so Chromium will also be able to set
'gtest_enable_absl_printers=true'.

Bug: 1046390
Change-Id: Ifffea81ba8f7a9412bebc3798e8f79eaff2777d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2262972
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
Auto-Submit: Mirko Bonadei <mbonadei@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782889}
parent 93c58ec9
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
# without these options will be part of the same program. # without these options will be part of the same program.
import("//build/toolchain/toolchain.gni") import("//build/toolchain/toolchain.gni")
import("//build_overrides/build.gni")
import("//testing/test.gni") import("//testing/test.gni")
config("absl_component_build") { config("absl_component_build") {
...@@ -62,6 +63,17 @@ component("absl") { ...@@ -62,6 +63,17 @@ component("absl") {
"//third_party/abseil-cpp/absl/types:optional", "//third_party/abseil-cpp/absl/types:optional",
"//third_party/abseil-cpp/absl/types:variant", "//third_party/abseil-cpp/absl/types:variant",
] ]
if (!build_with_chromium && gtest_enable_absl_printers) {
# The following dependencies contain static initializers which are
# banned by Chromium. They are needed by gtest when the GN arg
# gtest_enable_absl_printers is set to true (this is never done by
# Chromium).
public_deps += [
"//third_party/abseil-cpp/absl/debugging:failure_signal_handler",
"//third_party/abseil-cpp/absl/debugging:stacktrace",
"//third_party/abseil-cpp/absl/debugging:symbolize",
]
}
} }
group("default") { group("default") {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment