blob: 5df8b1aba69a0a62735f42b0fffc0bdd81fb5a47 [file] [log] [blame]
danakjc391f332017-07-12 20:45:521# Copyright 2016 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//testing/test.gni")
6
7viz_remove_configs = []
8viz_add_configs = [ "//build/config:precompiled_headers" ]
9
10if (!is_debug && (is_win || is_android)) {
11 viz_remove_configs += [ "//build/config/compiler:default_optimization" ]
12 viz_add_configs += [ "//build/config/compiler:optimize_max" ]
13}
14
15template("viz_source_set") {
16 source_set(target_name) {
17 forward_variables_from(invoker, "*", [ "configs" ])
18 if (defined(invoker.configs)) {
19 configs += invoker.configs
20 }
21 configs -= viz_remove_configs
22 configs += viz_add_configs
23 }
24}
25
26template("viz_component") {
27 component(target_name) {
28 forward_variables_from(invoker, "*", [ "configs" ])
29 if (defined(invoker.configs)) {
30 configs += invoker.configs
31 }
32 configs -= viz_remove_configs
33 configs += viz_add_configs
34 }
35}
36
37template("viz_static_library") {
38 static_library(target_name) {
39 forward_variables_from(invoker, "*", [ "configs" ])
40 if (defined(invoker.configs)) {
41 configs += invoker.configs
42 }
43 configs -= viz_remove_configs
44 configs += viz_add_configs
45 }
46}
47
48template("viz_test") {
49 test(target_name) {
50 forward_variables_from(invoker, "*", [ "configs" ])
51 if (defined(invoker.configs)) {
52 configs += invoker.configs
53 }
54 configs -= viz_remove_configs
55 configs += viz_add_configs
56 }
57}