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 import("//build/config/chrome_build.gni") | 8 import("//build/config/chrome_build.gni") |
9 | 9 |
10 declare_args() { | 10 declare_args() { |
11 # Enable Link Time Optimization in optimized builds (output programs run | 11 # Enable Link Time Optimization in optimized builds (output programs run |
12 # faster, but linking is up to 5-20x slower). | 12 # faster, but linking is up to 5-20x slower). |
13 # Note: use target_os == "linux" rather than is_linux so that it does not | 13 # Note: use target_os == "linux" rather than is_linux so that it does not |
14 # apply to host_toolchain when target_os="android". | 14 # apply to host_toolchain when target_os="android". |
15 allow_posix_link_time_opt = | 15 allow_posix_link_time_opt = |
16 target_os == "linux" && !is_chromeos && target_cpu == "x64" && | 16 target_os == "linux" && !is_chromeos && target_cpu == "x64" && |
17 is_chrome_branded && is_official_build | 17 is_chrome_branded && is_official_build |
18 | 18 |
19 # Set to true to use lld, the LLVM linker. This flag may be used on Windows | 19 # Set to true to use lld, the LLVM linker. This flag may be used on Windows |
20 # with the shipped LLVM toolchain, or on Linux with a self-built top-of-tree | 20 # with the shipped LLVM toolchain, or on Linux with a self-built top-of-tree |
21 # LLVM toolchain (see llvm_force_head_revision in | 21 # LLVM toolchain (see llvm_force_head_revision in |
22 # build/config/compiler/BUILD.gn). | 22 # build/config/compiler/BUILD.gn). |
23 use_lld = is_win && host_os != "win" | 23 use_lld = is_win && host_os != "win" |
24 | 24 |
25 if (is_clang) { | 25 # If this is set to true, or if LLVM_FORCE_HEAD_REVISION is set to 1 |
26 # Clang compiler version. Clang files are placed at version-dependent paths. | 26 # in the environment, we use the revision in the llvm repo to determine |
27 clang_version = "3.9.0" | 27 # the CLANG_REVISION to use, instead of the version hard-coded into |
28 } | 28 # //tools/clang/scripts/update.py. This should only be used in |
| 29 # conjunction with setting LLVM_FORCE_HEAD_REVISION in the |
| 30 # environment when `gclient runhooks` is run as well. |
| 31 llvm_force_head_revision = false |
29 | 32 |
30 # Compile with Xcode version of clang instead of hermetic version shipped | 33 # Compile with Xcode version of clang instead of hermetic version shipped |
31 # with the build. Used on iOS to ship official builds (as they are built | 34 # with the build. Used on iOS to ship official builds (as they are built |
32 # with the version of clang shipped with Xcode). | 35 # with the version of clang shipped with Xcode). |
33 use_xcode_clang = is_ios && is_official_build | 36 use_xcode_clang = is_ios && is_official_build |
34 } | 37 } |
35 | 38 |
| 39 if (is_clang) { |
| 40 # Clang compiler version. Clang files are placed at version-dependent paths. |
| 41 clang_version = "3.9.0" |
| 42 |
| 43 if (llvm_force_head_revision) { |
| 44 # TODO(hans): Remove after next Clang roll. |
| 45 # ToT Clang has a higher version number. |
| 46 clang_version = "4.0.0" |
| 47 } |
| 48 } |
| 49 |
36 assert(!use_xcode_clang || is_ios, | 50 assert(!use_xcode_clang || is_ios, |
37 "Using Xcode's clang is only supported in iOS builds") | 51 "Using Xcode's clang is only supported in iOS builds") |
38 | 52 |
39 # Subdirectory within root_out_dir for shared library files. | 53 # Subdirectory within root_out_dir for shared library files. |
40 # TODO(agrieve): GYP sets this to "lib" for Linux & Android, but this won't work | 54 # TODO(agrieve): GYP sets this to "lib" for Linux & Android, but this won't work |
41 # in GN until support for loadable_module() is added. | 55 # in GN until support for loadable_module() is added. |
42 # See: https://codereview.chromium.org/1236503002/ | 56 # See: https://codereview.chromium.org/1236503002/ |
43 shlib_subdir = "." | 57 shlib_subdir = "." |
44 | 58 |
45 # Root out dir for shared library files. | 59 # Root out dir for shared library files. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 stamp_description = "STAMP {{output}}" | 93 stamp_description = "STAMP {{output}}" |
80 copy_description = "COPY {{source}} {{output}}" | 94 copy_description = "COPY {{source}} {{output}}" |
81 if (host_os == "win") { | 95 if (host_os == "win") { |
82 stamp_command = "$python_path gyp-win-tool stamp {{output}}" | 96 stamp_command = "$python_path gyp-win-tool stamp {{output}}" |
83 copy_command = | 97 copy_command = |
84 "$python_path gyp-win-tool recursive-mirror {{source}} {{output}}" | 98 "$python_path gyp-win-tool recursive-mirror {{source}} {{output}}" |
85 } else { | 99 } else { |
86 stamp_command = "touch {{output}}" | 100 stamp_command = "touch {{output}}" |
87 copy_command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}}
&& cp -af {{source}} {{output}})" | 101 copy_command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}}
&& cp -af {{source}} {{output}})" |
88 } | 102 } |
OLD | NEW |