Adding absl includes and defines to rtc_* templates.
This CL implicitly adds the -I compiler flag and absl macros to WebRTC templates. In order to include absl headers using relative paths, WebRTC needs to ensure that all its build targets are able to see absl headers. This can also be done with public_deps, but WebRTC is trying to avoid it because it creates problems with other build systems. Given this constraint, using rtc_* templates is the most reliable solution. Please note that rtc_* templates are adding absl includes and defines as public_configs, this means that build targets with WebRTC targets in their public_deps will propagate these configs following the GN guideline. Bug: webrtc:8821 Change-Id: I4aa594a524f4bd045bcb3e80d76cc27f06fe01d7 Reviewed-on: https://webrtc-review.googlesource.com/70367 Reviewed-by: Patrik Höglund <phoglund@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22927}
This commit is contained in:

committed by
Commit Bot

parent
8e0b15b584
commit
9d8f3850f4
33
webrtc.gni
33
webrtc.gni
@ -278,6 +278,9 @@ if (build_with_chromium) {
|
||||
webrtc_default_visibility += [ webrtc_root + "/../webrtc_overrides/*" ]
|
||||
}
|
||||
|
||||
absl_include_config = "//third_party/abseil-cpp:absl_include_config"
|
||||
absl_define_config = "//third_party/abseil-cpp:absl_define_config"
|
||||
|
||||
template("rtc_test") {
|
||||
test(target_name) {
|
||||
forward_variables_from(invoker,
|
||||
@ -296,7 +299,11 @@ template("rtc_test") {
|
||||
configs += invoker.configs
|
||||
configs -= rtc_remove_configs
|
||||
configs -= invoker.suppressed_configs
|
||||
public_configs = [ rtc_common_inherited_config ]
|
||||
public_configs = [
|
||||
rtc_common_inherited_config,
|
||||
absl_include_config,
|
||||
absl_define_config,
|
||||
]
|
||||
if (defined(invoker.public_configs)) {
|
||||
public_configs += invoker.public_configs
|
||||
}
|
||||
@ -324,7 +331,11 @@ template("rtc_source_set") {
|
||||
configs += invoker.configs
|
||||
configs -= rtc_remove_configs
|
||||
configs -= invoker.suppressed_configs
|
||||
public_configs = [ rtc_common_inherited_config ]
|
||||
public_configs = [
|
||||
rtc_common_inherited_config,
|
||||
absl_include_config,
|
||||
absl_define_config,
|
||||
]
|
||||
if (defined(invoker.public_configs)) {
|
||||
public_configs += invoker.public_configs
|
||||
}
|
||||
@ -354,7 +365,11 @@ template("rtc_executable") {
|
||||
]
|
||||
deps += invoker.deps
|
||||
|
||||
public_configs = [ rtc_common_inherited_config ]
|
||||
public_configs = [
|
||||
rtc_common_inherited_config,
|
||||
absl_include_config,
|
||||
absl_define_config,
|
||||
]
|
||||
if (defined(invoker.public_configs)) {
|
||||
public_configs += invoker.public_configs
|
||||
}
|
||||
@ -378,7 +393,11 @@ template("rtc_static_library") {
|
||||
configs += invoker.configs
|
||||
configs -= rtc_remove_configs
|
||||
configs -= invoker.suppressed_configs
|
||||
public_configs = [ rtc_common_inherited_config ]
|
||||
public_configs = [
|
||||
rtc_common_inherited_config,
|
||||
absl_include_config,
|
||||
absl_define_config,
|
||||
]
|
||||
if (defined(invoker.public_configs)) {
|
||||
public_configs += invoker.public_configs
|
||||
}
|
||||
@ -402,7 +421,11 @@ template("rtc_shared_library") {
|
||||
configs += invoker.configs
|
||||
configs -= rtc_remove_configs
|
||||
configs -= invoker.suppressed_configs
|
||||
public_configs = [ rtc_common_inherited_config ]
|
||||
public_configs = [
|
||||
rtc_common_inherited_config,
|
||||
absl_include_config,
|
||||
absl_define_config,
|
||||
]
|
||||
if (defined(invoker.public_configs)) {
|
||||
public_configs += invoker.public_configs
|
||||
}
|
||||
|
Reference in New Issue
Block a user