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