Fix LOGGING_INSIDE_WEBRTC propagation in Chromium builds.
This macro needs to be both present in all WebRTC targets (see its
definition in at [1] but also propagated to all the targets
depending on the Chromium component defined in
//third_party/webrtc_overrides:webrtc_component (to properly support
transitive header #includes), by using "public_config" GN propagates
the macro accordingly.
[1] - https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/BUILD.gn;l=315;drc=61dbc2db2b84eed9c9769c1b79070e6bd4030331
Bug: None
Change-Id: Idd51643da63be48324c86a5b89676c63c3998e14
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251440
Reviewed-by: Björn Terelius <terelius@google.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35972}
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index f5a1c95..33d867a 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -284,6 +284,10 @@
}
}
+config("chromium_logging_config") {
+ defines = ["LOGGING_INSIDE_WEBRTC"]
+}
+
rtc_library("logging") {
visibility = [ "*" ]
libs = []
@@ -308,6 +312,12 @@
"../../webrtc_overrides/rtc_base/logging.cc",
"../../webrtc_overrides/rtc_base/logging.h",
]
+ # This macro needs to be both present in all WebRTC targets (see its
+ # definition in //BUILD.gn but also propagated to all the targets
+ # depending on the Chromium component defined in
+ # //third_party/webrtc_overrides:webrtc_component. This public_config
+ # allows GN to propagate the macro accordingly.
+ public_configs = [":chromium_logging_config"]
} else {
sources = [
"logging.cc",