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 # Toolchain-related configuration that may be needed outside the context of the | 5 # Toolchain-related configuration that may be needed outside the context of the |
6 # toolchain() rules themselves. | 6 # toolchain() rules themselves. |
7 | 7 |
8 # Subdirectory within root_out_dir for shared library files. | 8 # Subdirectory within root_out_dir for shared library files. |
9 # TODO(agrieve): GYP sets this to "lib" for Linux & Android, but this won't work | 9 # TODO(agrieve): GYP sets this to "lib" for Linux & Android, but this won't work |
10 # in GN until support for loadable_module() is added. | 10 # in GN until support for loadable_module() is added. |
(...skipping 20 matching lines...) Expand all Loading... |
31 } else { | 31 } else { |
32 assert(false, "Platform not supported") | 32 assert(false, "Platform not supported") |
33 } | 33 } |
34 | 34 |
35 # Prefix for shared library files. | 35 # Prefix for shared library files. |
36 if (is_posix) { | 36 if (is_posix) { |
37 shlib_prefix = "lib" | 37 shlib_prefix = "lib" |
38 } else { | 38 } else { |
39 shlib_prefix = "" | 39 shlib_prefix = "" |
40 } | 40 } |
| 41 |
| 42 # While other "tool"s in a toolchain are specific to the target of that |
| 43 # toolchain, the "stamp" and "copy" tools are really generic to the host; |
| 44 # but each toolchain must define them separately. GN doesn't allow a |
| 45 # template instantiation inside a toolchain definition, so some boilerplate |
| 46 # has to be repeated in each toolchain to define these two tools. These |
| 47 # four variables reduce the duplication in that boilerplate. |
| 48 stamp_description = "STAMP {{output}}" |
| 49 copy_description = "COPY {{source}} {{output}}" |
| 50 if (host_os == "win") { |
| 51 stamp_command = "$python_path gyp-win-tool stamp {{output}}" |
| 52 copy_command = |
| 53 "$python_path gyp-win-tool recursive-mirror {{source}} {{output}}" |
| 54 } else { |
| 55 stamp_command = "touch {{output}}" |
| 56 copy_command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}}
&& cp -af {{source}} {{output}})" |
| 57 } |
OLD | NEW |