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