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 template("split_static_library") { | 5 template("split_static_library") { |
6 assert(defined(invoker.split_count), | 6 assert(defined(invoker.split_count), |
7 "Must define split_count for split_static_library") | 7 "Must define split_count for split_static_library") |
8 | 8 |
9 # In many conditions the number of inputs will be 1 (because the count will | 9 # In many conditions the number of inputs will be 1 (because the count will |
10 # be conditional on platform or configuration) so optimize that. | 10 # be conditional on platform or configuration) so optimize that. |
(...skipping 18 matching lines...) Expand all Loading... |
29 # we're redefining) and visibility (which is set to be the group | 29 # we're redefining) and visibility (which is set to be the group |
30 # below). | 30 # below). |
31 forward_variables_from(invoker, | 31 forward_variables_from(invoker, |
32 "*", | 32 "*", |
33 [ | 33 [ |
34 "sources", | 34 "sources", |
35 "visibility", | 35 "visibility", |
36 ]) | 36 ]) |
37 sources = current_sources | 37 sources = current_sources |
38 visibility = [ ":$group_name" ] | 38 visibility = [ ":$group_name" ] |
| 39 |
| 40 # Uniquify the output name if one is specified. |
| 41 if (defined(invoker.output_name)) { |
| 42 output_name = "${invoker.output_name}_$current_library_index" |
| 43 } |
39 } | 44 } |
40 | 45 |
41 current_library_index = current_library_index + 1 | 46 current_library_index = current_library_index + 1 |
42 } | 47 } |
43 | 48 |
44 group(group_name) { | 49 group(group_name) { |
45 public_deps = generated_static_libraries | 50 public_deps = generated_static_libraries |
46 forward_variables_from(invoker, | 51 forward_variables_from(invoker, |
47 [ | 52 [ |
48 "testonly", | 53 "testonly", |
49 "visibility", | 54 "visibility", |
50 ]) | 55 ]) |
51 } | 56 } |
52 } | 57 } |
53 } | 58 } |
54 | 59 |
55 set_defaults("split_static_library") { | 60 set_defaults("split_static_library") { |
56 configs = default_compiler_configs | 61 configs = default_compiler_configs |
57 } | 62 } |
OLD | NEW |