OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 # Creates a symlink. | 5 # Creates a symlink. |
6 # Args: | 6 # Args: |
7 # source: Path to link to. | 7 # source: Path to link to. |
8 # output: Where to create the symlink. | 8 # output: Where to create the symlink. |
9 template("symlink") { | 9 template("symlink") { |
10 action(target_name) { | 10 action(target_name) { |
11 forward_variables_from(invoker, | 11 forward_variables_from(invoker, |
12 [ | 12 [ |
| 13 "data_deps", |
13 "deps", | 14 "deps", |
14 "testonly", | 15 "testonly", |
15 "visibility", | 16 "visibility", |
16 ]) | 17 ]) |
17 outputs = [ | 18 outputs = [ |
18 invoker.output, | 19 invoker.output, |
19 ] | 20 ] |
20 script = "//build/symlink.py" | 21 script = "//build/symlink.py" |
21 args = [ | 22 args = [ |
22 "-f", | 23 "-f", |
(...skipping 30 matching lines...) Expand all Loading... |
53 symlink(target_name) { | 54 symlink(target_name) { |
54 forward_variables_from(invoker, | 55 forward_variables_from(invoker, |
55 [ | 56 [ |
56 "output", | 57 "output", |
57 "testonly", | 58 "testonly", |
58 "visibility", | 59 "visibility", |
59 ]) | 60 ]) |
60 deps = [ | 61 deps = [ |
61 invoker.binary_label, | 62 invoker.binary_label, |
62 ] | 63 ] |
| 64 data_deps = [ |
| 65 invoker.binary_label, |
| 66 ] |
| 67 if (defined(invoker.data_deps)) { |
| 68 data_deps += invoker.data_deps |
| 69 } |
63 | 70 |
64 _out_dir = get_label_info(invoker.binary_label, "root_out_dir") | 71 _out_dir = get_label_info(invoker.binary_label, "root_out_dir") |
65 if (defined(invoker.binary_output_name)) { | 72 if (defined(invoker.binary_output_name)) { |
66 _name = invoker.binary_output_name | 73 _name = invoker.binary_output_name |
67 } else { | 74 } else { |
68 _name = get_label_info(invoker.binary_label, "name") | 75 _name = get_label_info(invoker.binary_label, "name") |
69 } | 76 } |
70 source = "$_out_dir/$_name" | 77 source = "$_out_dir/$_name" |
71 | 78 |
72 _output_name = _name | 79 _output_name = _name |
73 if (defined(invoker.output_name)) { | 80 if (defined(invoker.output_name)) { |
74 _output_name = invoker.output_name | 81 _output_name = invoker.output_name |
75 } | 82 } |
76 output = "$root_out_dir/$_output_name" | 83 output = "$root_out_dir/$_output_name" |
77 } | 84 } |
78 } | 85 } |
OLD | NEW |