Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 # Creates a symlink. | |
| 6 # Args: | |
| 7 # source: Path to link to. | |
| 8 # output: Where to create the symlink. | |
| 9 template("symlink") { | |
| 10 action(target_name) { | |
| 11 forward_variables_from(invoker, | |
| 12 [ | |
| 13 "deps", | |
| 14 "testonly", | |
| 15 "visibility", | |
| 16 ]) | |
| 17 outputs = [ | |
| 18 invoker.output, | |
| 19 ] | |
| 20 script = "//build/symlink.py" | |
| 21 args = [ | |
| 22 "-f", | |
| 23 rebase_path(invoker.source, get_path_info(invoker.output, "dir")), | |
| 24 rebase_path(invoker.output, root_build_dir), | |
| 25 ] | |
| 26 } | |
| 27 } | |
| 28 | |
| 29 # Creates a symlink from root_build_dir/target_name to |binary_label|, which | |
| 30 # can be convenient when target_toolchain != host_toolchain. | |
| 31 # Note that for executables, using a copy (as opposed to a symlink) does not | |
| 32 # work when is_component_build=true, since dependent libraries are found via | |
| 33 # relative location. | |
|
brettw
2015/12/10 18:20:03
I think it would be worth adding here how you will
agrieve
2015/12/11 10:37:01
Done.
| |
| 34 # Args: | |
| 35 # binary_label: Target that builds the file to symlink to. e.g.: | |
| 36 # ":foo($host_toolchain)". | |
| 37 # output: Where to create the symlink (default="$root_out_dir/$target_name") | |
| 38 template("host_binary_symlink") { | |
|
brettw
2015/12/10 18:20:03
Since callers how have to specify the toolchain in
agrieve
2015/12/11 10:37:01
Done.
| |
| 39 symlink(target_name) { | |
| 40 forward_variables_from(invoker, | |
| 41 [ | |
| 42 "output", | |
| 43 "testonly", | |
| 44 "visibility", | |
| 45 ]) | |
| 46 deps = [ | |
| 47 invoker.binary_label, | |
| 48 ] | |
| 49 | |
| 50 _out_dir = get_label_info(invoker.binary_label, "root_out_dir") | |
| 51 source = "$_out_dir/" + get_label_info(invoker.binary_label, "name") | |
| 52 | |
| 53 if (!defined(output)) { | |
| 54 output = "$root_out_dir/${invoker.target_name}" | |
| 55 } | |
| 56 } | |
| 57 } | |
| OLD | NEW |