Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Unified Diff: webrtc/build/webrtc.gni

Issue 2301053002: GN: Introduce templates. (Closed)
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/BUILD.gn ('k') | webrtc/call/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/build/webrtc.gni
diff --git a/webrtc/build/webrtc.gni b/webrtc/build/webrtc.gni
index 25d7258268620397952961f1b190afb073adca1f..49a3bc774c57c71339b9a84988aff47c6cf8a182 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.
@@ -148,3 +149,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 = []
+ suppressed_configs = []
+}
+
+set_defaults("rtc_source_set") {
+ configs = []
+ suppressed_configs = []
+}
+
+set_defaults("rtc_executable") {
+ configs = []
+ suppressed_configs = []
+}
+
+set_defaults("rtc_static_library") {
+ configs = []
+ suppressed_configs = []
+}
+
+template("rtc_test") {
+ test(target_name) {
+ forward_variables_from(invoker,
+ "*",
+ [
+ "configs",
+ "suppressed_configs",
+ ])
+ configs += invoker.configs
+ configs += rtc_add_configs
+ configs -= rtc_remove_configs
+ configs -= invoker.suppressed_configs
+ }
+}
+
+template("rtc_source_set") {
+ source_set(target_name) {
+ forward_variables_from(invoker,
+ "*",
+ [
+ "configs",
+ "suppressed_configs",
+ ])
+ configs += invoker.configs
+ configs += rtc_add_configs
+ configs -= rtc_remove_configs
+ configs -= invoker.suppressed_configs
+ }
+}
+
+template("rtc_executable") {
+ executable(target_name) {
+ forward_variables_from(invoker,
+ "*",
+ [
+ "configs",
+ "suppressed_configs",
+ ])
+ configs += invoker.configs
+ configs += rtc_add_configs
+ configs -= rtc_remove_configs
+ configs -= invoker.suppressed_configs
+ }
+}
+
+template("rtc_static_library") {
+ static_library(target_name) {
+ forward_variables_from(invoker,
+ "*",
+ [
+ "configs",
+ "suppressed_configs",
+ ])
+ configs += invoker.configs
+ configs += rtc_add_configs
+ configs -= rtc_remove_configs
+ configs -= invoker.suppressed_configs
+ }
+}
« no previous file with comments | « webrtc/base/BUILD.gn ('k') | webrtc/call/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698