Chromium Code Reviews| Index: webrtc/build/webrtc.gni |
| diff --git a/webrtc/build/webrtc.gni b/webrtc/build/webrtc.gni |
| index a6282b84feb11e38522988ea9e5c367e623b3493..a4e714dc0ac6ef210dfd24ff1c94adcf6d69e999 100644 |
| --- a/webrtc/build/webrtc.gni |
| +++ b/webrtc/build/webrtc.gni |
| @@ -10,6 +10,7 @@ import("//build/config/arm.gni") |
| import("//build/config/features.gni") |
| import("//build/config/mips.gni") |
| import("//build_overrides/webrtc.gni") |
| +import("//testing/test.gni") |
| declare_args() { |
| # Disable this to avoid building the Opus audio codec. |
| @@ -144,3 +145,97 @@ declare_args() { |
| rtc_libvpx_dir = "//third_party/libvpx" |
| rtc_libyuv_dir = "//third_party/libyuv" |
| rtc_opus_dir = "//third_party/opus" |
| + |
| +############################################################################### |
| +# Templates |
| +# |
| + |
| +# Points to //webrtc/ in webrtc stand-alone or to //third_party/webrtc/ in |
| +# chromium. |
| +# We need absolute paths for all configs in templates as they are shared in |
| +# different subdirectories. |
| +webrtc_root = get_path_info("../", "abspath") |
| + |
| +# Common configs to remove or add in all rtc targets. |
| +rtc_remove_configs = [] |
| +rtc_add_configs = [] |
| + |
| +set_defaults("rtc_test") { |
| + configs = [] |
| + configs_suppressions = [] |
|
kjellander_webrtc
2016/09/01 19:55:29
I'm not fully happy with this name, as we're using
|
| +} |
| + |
| +set_defaults("rtc_source_set") { |
| + configs = [] |
| + configs_suppressions = [] |
| +} |
| + |
| +set_defaults("rtc_executable") { |
| + configs = [] |
| + configs_suppressions = [] |
| +} |
| + |
| +set_defaults("rtc_static_library") { |
| + configs = [] |
| + configs_suppressions = [] |
| +} |
| + |
| +template("rtc_test") { |
| + test(target_name) { |
| + forward_variables_from(invoker, |
| + "*", |
| + [ |
| + "configs", |
| + "configs_suppressions", |
| + ]) |
| + configs += invoker.configs |
| + configs += rtc_add_configs |
| + configs -= rtc_remove_configs |
| + configs -= invoker.configs_suppressions |
| + } |
| +} |
| + |
| +template("rtc_source_set") { |
| + source_set(target_name) { |
| + forward_variables_from(invoker, |
| + "*", |
| + [ |
| + "configs", |
| + "configs_suppressions", |
| + ]) |
| + configs += invoker.configs |
| + configs += rtc_add_configs |
| + configs -= rtc_remove_configs |
| + configs -= invoker.configs_suppressions |
| + } |
| +} |
| + |
| +template("rtc_executable") { |
| + executable(target_name) { |
| + forward_variables_from(invoker, |
| + "*", |
| + [ |
| + "configs", |
| + "configs_suppressions", |
| + ]) |
| + configs += invoker.configs |
| + configs += rtc_add_configs |
| + configs -= rtc_remove_configs |
| + configs -= invoker.configs_suppressions |
| + } |
| +} |
| + |
| +template("rtc_static_library") { |
| + static_library(target_name) { |
| + forward_variables_from(invoker, |
| + "*", |
| + [ |
| + "configs", |
| + "configs_suppressions", |
| + ]) |
| + configs += invoker.configs |
| + configs += rtc_add_configs |
| + configs -= rtc_remove_configs |
| + configs -= invoker.configs_suppressions |
| + } |
| +} |