| 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) { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 # executable("foo") { ... } | 46 # executable("foo") { ... } |
| 47 # } else if (current_toolchain == default_toolchain) { | 47 # } else if (current_toolchain == default_toolchain) { |
| 48 # binary_symlink("foo") { | 48 # binary_symlink("foo") { |
| 49 # binary_label = ":foo($host_toolchain)" | 49 # binary_label = ":foo($host_toolchain)" |
| 50 # } | 50 # } |
| 51 # } | 51 # } |
| 52 template("binary_symlink") { | 52 template("binary_symlink") { |
| 53 symlink(target_name) { | 53 symlink(target_name) { |
| 54 forward_variables_from(invoker, | 54 forward_variables_from(invoker, |
| 55 [ | 55 [ |
| 56 "output", | |
| 57 "testonly", | 56 "testonly", |
| 58 "visibility", | 57 "visibility", |
| 59 ]) | 58 ]) |
| 60 deps = [ | 59 deps = [ |
| 61 invoker.binary_label, | 60 invoker.binary_label, |
| 62 ] | 61 ] |
| 63 | 62 |
| 64 _out_dir = get_label_info(invoker.binary_label, "root_out_dir") | 63 _out_dir = get_label_info(invoker.binary_label, "root_out_dir") |
| 65 if (defined(invoker.binary_output_name)) { | 64 if (defined(invoker.binary_output_name)) { |
| 66 _name = invoker.binary_output_name | 65 _name = invoker.binary_output_name |
| 67 } else { | 66 } else { |
| 68 _name = get_label_info(invoker.binary_label, "name") | 67 _name = get_label_info(invoker.binary_label, "name") |
| 69 } | 68 } |
| 70 source = "$_out_dir/$_name" | 69 source = "$_out_dir/$_name" |
| 71 | 70 |
| 72 _output_name = _name | 71 _output_name = _name |
| 73 if (defined(invoker.output_name)) { | 72 if (defined(invoker.output_name)) { |
| 74 _output_name = invoker.output_name | 73 _output_name = invoker.output_name |
| 75 } | 74 } |
| 76 output = "$root_out_dir/$_output_name" | 75 output = "$root_out_dir/$_output_name" |
| 77 } | 76 } |
| 78 } | 77 } |
| OLD | NEW |