Use Chromium's abseil build files when building in ANGLE
Dawn's abseil build files at third_party/gn/abseil-cpp have to stay
because Skia is unable to build with the Chromium GN files.
ANGLE frequently updates abseil to match Chromium's and this often
breaks builds when Dawn's build files cannot work with the new abseil
checkout.
Add a new build_with_angle variable to know when building in an ANGLE
checkout and use the chromium abseil build files in that situation.
Bug: angleproject:8555
Change-Id: If8209dd9e6c52f86f9fda92d06212a694833abc3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/187721
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Geoff Lang <geofflang@google.com>
diff --git a/build_overrides/dawn.gni b/build_overrides/dawn.gni
index 79e3911..4c5bff0 100644
--- a/build_overrides/dawn.gni
+++ b/build_overrides/dawn.gni
@@ -36,6 +36,9 @@
# True if Dawn can access build/, testing/ and other Chrome folders.
dawn_has_build = true
+# True if building within an ANGLE checkout
+build_with_angle = false
+
# Defaults for these are set again in dawn_overrides_with_defaults.gni so that
# users of Dawn don't have to set dirs if they happen to use the same as Dawn.
diff --git a/src/dawn/common/BUILD.gn b/src/dawn/common/BUILD.gn
index 4efb268..723fbc4 100644
--- a/src/dawn/common/BUILD.gn
+++ b/src/dawn/common/BUILD.gn
@@ -233,10 +233,10 @@
}
group("abseil") {
- # When build_with_chromium=true we need to include "//third_party/abseil-cpp:absl" while
+ # When building within Chromium or ANGLE we need to include "//third_party/abseil-cpp:absl" while
# it's beneficial to be more specific with standalone Dawn, especially when it comes to
# including it as a dependency in other projects (such as Skia).
- if (build_with_chromium) {
+ if (build_with_chromium || build_with_angle) {
public_deps = [ "$dawn_abseil_dir:absl" ]
} else {
public_deps = [ "${dawn_root}/third_party/gn/abseil-cpp:inlined_vector" ]
diff --git a/src/dawn/native/BUILD.gn b/src/dawn/native/BUILD.gn
index 880c6f1..450a056 100644
--- a/src/dawn/native/BUILD.gn
+++ b/src/dawn/native/BUILD.gn
@@ -55,10 +55,10 @@
}
group("abseil") {
- # When build_with_chromium=true we need to include "//third_party/abseil-cpp:absl" while
+ # When building within Chromium or ANGLE we need to include "//third_party/abseil-cpp:absl" while
# it's beneficial to be more specific with standalone Dawn, especially when it comes to
# including it as a dependency in other projects (such as Skia).
- if (build_with_chromium) {
+ if (build_with_chromium || build_with_angle) {
public_deps = [ "$dawn_abseil_dir:absl" ]
} else {
public_deps = [
diff --git a/src/dawn/wire/BUILD.gn b/src/dawn/wire/BUILD.gn
index a4023a2..51f5e68 100644
--- a/src/dawn/wire/BUILD.gn
+++ b/src/dawn/wire/BUILD.gn
@@ -63,10 +63,10 @@
}
group("abseil") {
- # When build_with_chromium=true we need to include "//third_party/abseil-cpp:absl" while
+ # When building within Chromium or ANGLE we need to include "//third_party/abseil-cpp:absl" while
# it's beneficial to be more specific with standalone Dawn, especially when it comes to
# including it as a dependency in other projects (such as Skia).
- if (build_with_chromium) {
+ if (build_with_chromium || build_with_angle) {
public_deps = [ "$dawn_abseil_dir:absl" ]
} else {
public_deps = [
diff --git a/src/tint/BUILD.gn b/src/tint/BUILD.gn
index 30d21d4..f17d0f3 100644
--- a/src/tint/BUILD.gn
+++ b/src/tint/BUILD.gn
@@ -242,10 +242,10 @@
}
group("abseil") {
- # When build_with_chromium=true we need to include "//third_party/abseil-cpp:absl" while
+ # When building within Chromium or ANGLE we need to include "//third_party/abseil-cpp:absl" while
# it's beneficial to be more specific with standalone Dawn, especially when it comes to
# including it as a dependency in other projects (such as Skia).
- if (build_with_chromium) {
+ if (build_with_chromium || build_with_angle) {
public_deps = [ "$dawn_abseil_dir:absl" ]
} else {
public_deps = [ "${dawn_root}/third_party/gn/abseil-cpp:strings" ]