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 "deps", | 13 "deps", |
14 "testonly", | 14 "testonly", |
15 "visibility", | 15 "visibility", |
16 ]) | 16 ]) |
17 outputs = [ | 17 outputs = [ |
18 invoker.output, | 18 invoker.output, |
19 ] | 19 ] |
20 script = "//build/symlink.py" | 20 script = "//build/symlink.py" |
21 args = [ | 21 args = [ |
| 22 "--update-target-mtimes", |
22 "-f", | 23 "-f", |
23 rebase_path(invoker.source, get_path_info(invoker.output, "dir")), | 24 rebase_path(invoker.source, get_path_info(invoker.output, "dir")), |
24 rebase_path(invoker.output, root_build_dir), | 25 rebase_path(invoker.output, root_build_dir), |
25 ] | 26 ] |
26 } | 27 } |
27 } | 28 } |
28 | 29 |
29 # Creates a symlink from root_build_dir/target_name to |binary_label|. This rule | 30 # Creates a symlink from root_build_dir/target_name to |binary_label|. This rule |
30 # is meant to be used within if (current_toolchain == default_toolchain) blocks | 31 # is meant to be used within if (current_toolchain == default_toolchain) blocks |
31 # and point to targets in the non-default toolchain. | 32 # and point to targets in the non-default toolchain. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 70 } |
70 source = "$_out_dir/$_name" | 71 source = "$_out_dir/$_name" |
71 | 72 |
72 _output_name = _name | 73 _output_name = _name |
73 if (defined(invoker.output_name)) { | 74 if (defined(invoker.output_name)) { |
74 _output_name = invoker.output_name | 75 _output_name = invoker.output_name |
75 } | 76 } |
76 output = "$root_out_dir/$_output_name" | 77 output = "$root_out_dir/$_output_name" |
77 } | 78 } |
78 } | 79 } |
OLD | NEW |