Source code

Revision control

Copy as Markdown

Other Tools

From: Michael Froman <mfroman@mozilla.com>
Date: Thu, 10 Oct 2024 13:42:00 +0000
Subject: Bug 1921707 - absl.gni - filter dep paths from
'//third_party/abseil-cpp/' to '//' r=ng
---
abseil-cpp/absl.gni | 54 ++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 53 insertions(+), 1 deletion(-)
diff --git a/abseil-cpp/absl.gni b/abseil-cpp/absl.gni
index 8fbdcf0a8d1..e230d0a5cc0 100644
--- a/abseil-cpp/absl.gni
+++ b/abseil-cpp/absl.gni
@@ -86,8 +86,45 @@ template("absl_source_set") {
visibility = [ "*" ]
}
}
+ visibility += [ "//abseil-cpp/*" ]
+
+ # Now that abseil-cpp lives under Mozilla's third_party instead
+ # of under libwebrtc's third_party and is built as a stand-alone
+ # library, we need to "re-root" the dependency paths. We can
+ # modify the dependencies here to avoid modifying most, if not
+ # all, of the BUILD.gn files.
+ if (defined(deps)) {
+ modified_deps = []
+ foreach (dep, deps) {
+ newdep = string_replace(dep, "//third_party/abseil-cpp/", "//")
+ modified_deps += [ newdep ]
+ }
+ deps = []
+ deps = modified_deps
+ }
+
+ # Same for public_deps
+ if (defined(public_deps)) {
+ modified_deps = []
+ foreach (dep, public_deps) {
+ newdep = string_replace(dep, "//third_party/abseil-cpp/", "//")
+ modified_deps += [ newdep ]
+ }
+ public_deps = []
+ public_deps = modified_deps
+ }
+
+ # Same for visibility
+ if (defined(visibility)) {
+ modified_deps = []
+ foreach (dep, visibility) {
+ newdep = string_replace(dep, "//third_party/abseil-cpp/", "//")
+ modified_deps += [ newdep ]
+ }
+ visibility = []
+ visibility = modified_deps
+ }
}
- visibility += [ "//abseil-cpp/*" ]
}
}
@@ -117,5 +154,20 @@ template("absl_test") {
"//third_party/googletest:gtest",
]
}
+
+ # Now that abseil-cpp lives under Mozilla's third_party instead
+ # of under libwebrtc's third_party and is built as a stand-alone
+ # library, we need to "re-root" the dependency paths. We can
+ # modify the dependencies here to avoid modifying most, if not
+ # all, of the BUILD.gn files.
+ if (defined(deps)) {
+ modified_deps = []
+ foreach (dep, deps) {
+ newdep = string_replace(dep, "//third_party/abseil-cpp/", "//")
+ modified_deps += [ newdep ]
+ }
+ deps = []
+ deps = modified_deps
+ }
}
}