| 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_target(target_name) { |
| 18 target_type = "source_set" |
| 17 forward_variables_from(invoker, "*", [ "configs" ]) | 19 forward_variables_from(invoker, "*", [ "configs" ]) |
| 18 if (defined(invoker.configs)) { | 20 if (defined(invoker.configs)) { |
| 19 configs += invoker.configs | 21 configs += invoker.configs |
| 20 } | 22 } |
| 21 configs -= cc_remove_configs | 23 configs -= cc_remove_configs |
| 22 configs += cc_add_configs | 24 configs += cc_add_configs |
| 23 } | 25 } |
| 24 } | 26 } |
| 25 | 27 |
| 26 template("cc_component") { | 28 template("cc_component") { |
| 27 component(target_name) { | 29 jumbo_component(target_name) { |
| 30 target_type = "component" |
| 28 forward_variables_from(invoker, "*", [ "configs" ]) | 31 forward_variables_from(invoker, "*", [ "configs" ]) |
| 29 if (defined(invoker.configs)) { | 32 if (defined(invoker.configs)) { |
| 30 configs += invoker.configs | 33 configs += invoker.configs |
| 31 } | 34 } |
| 32 configs -= cc_remove_configs | 35 configs -= cc_remove_configs |
| 33 configs += cc_add_configs | 36 configs += cc_add_configs |
| 34 } | 37 } |
| 35 } | 38 } |
| 36 | 39 |
| 37 template("cc_static_library") { | 40 template("cc_static_library") { |
| 38 static_library(target_name) { | 41 jumbo_target(target_name) { |
| 42 target_type = "static_library" |
| 39 forward_variables_from(invoker, "*", [ "configs" ]) | 43 forward_variables_from(invoker, "*", [ "configs" ]) |
| 40 if (defined(invoker.configs)) { | 44 if (defined(invoker.configs)) { |
| 41 configs += invoker.configs | 45 configs += invoker.configs |
| 42 } | 46 } |
| 43 configs -= cc_remove_configs | 47 configs -= cc_remove_configs |
| 44 configs += cc_add_configs | 48 configs += cc_add_configs |
| 45 } | 49 } |
| 46 } | 50 } |
| 47 | 51 |
| 48 template("cc_test") { | 52 template("cc_test") { |
| 49 test(target_name) { | 53 test(target_name) { |
| 50 forward_variables_from(invoker, "*", [ "configs" ]) | 54 forward_variables_from(invoker, "*", [ "configs" ]) |
| 51 if (defined(invoker.configs)) { | 55 if (defined(invoker.configs)) { |
| 52 configs += invoker.configs | 56 configs += invoker.configs |
| 53 } | 57 } |
| 54 configs -= cc_remove_configs | 58 configs -= cc_remove_configs |
| 55 configs += cc_add_configs | 59 configs += cc_add_configs |
| 56 } | 60 } |
| 57 } | 61 } |
| OLD | NEW |