OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 import("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
6 import("//build/config/chrome_build.gni") | 6 import("//build/config/chrome_build.gni") |
7 import("//build/config/compiler/compiler.gni") | 7 import("//build/config/compiler/compiler.gni") |
8 import("//build/config/nacl/config.gni") | 8 import("//build/config/nacl/config.gni") |
9 import("//build/toolchain/cc_wrapper.gni") | 9 import("//build/toolchain/cc_wrapper.gni") |
10 import("//build/toolchain/toolchain.gni") | 10 import("//build/toolchain/toolchain.gni") |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 # If true, optimize for size. Does not affect windows builds. | 84 # If true, optimize for size. Does not affect windows builds. |
85 # Linux & Mac favor speed over size. | 85 # Linux & Mac favor speed over size. |
86 # TODO(brettw) it's weird that Mac and desktop Linux are different. We should | 86 # TODO(brettw) it's weird that Mac and desktop Linux are different. We should |
87 # explore favoring size over speed in this case as well. | 87 # explore favoring size over speed in this case as well. |
88 optimize_for_size = is_android || is_ios | 88 optimize_for_size = is_android || is_ios |
89 | 89 |
90 # Gold icf level, values are "none", "safe", "all". If value isn't overridden, | 90 # Gold icf level, values are "none", "safe", "all". If value isn't overridden, |
91 # default initialization is below. | 91 # default initialization is below. |
92 gold_icf_level = "" | 92 gold_icf_level = "" |
| 93 |
| 94 # If this is set to true, or if LLVM_FORCE_HEAD_REVISION is set to 1 |
| 95 # in the environment, we use the revision in the llvm repo to determine |
| 96 # the CLANG_REVISION to use, instead of the version hard-coded into |
| 97 # //tools/clang/scripts/update.py. This should only be used in |
| 98 # conjunction with setting LLVM_FORCE_HEAD_REVISION in the |
| 99 # environment when `gclient runhooks` is run as well. |
| 100 llvm_force_head_revision = false |
| 101 } |
| 102 |
| 103 if (is_clang && !is_nacl) { |
| 104 update_args = [ "--print-revision" ] |
| 105 if (llvm_force_head_revision) { |
| 106 update_args += [ "--llvm-force-head-revision" ] |
| 107 } |
| 108 clang_revision = |
| 109 exec_script("//tools/clang/scripts/update.py", update_args, "trim string") |
93 } | 110 } |
94 | 111 |
95 # Apply the default logic for these values if they were not set explicitly. | 112 # Apply the default logic for these values if they were not set explicitly. |
96 if (gold_path == false) { | 113 if (gold_path == false) { |
97 if (use_gold) { | 114 if (use_gold) { |
98 gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", | 115 gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", |
99 root_build_dir) | 116 root_build_dir) |
100 } else { | 117 } else { |
101 gold_path = "" | 118 gold_path = "" |
102 } | 119 } |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 "-Wno-undefined-bool-conversion", | 236 "-Wno-undefined-bool-conversion", |
220 "-Wno-tautological-undefined-compare", | 237 "-Wno-tautological-undefined-compare", |
221 ] | 238 ] |
222 } | 239 } |
223 | 240 |
224 if (is_clang && !is_nacl) { | 241 if (is_clang && !is_nacl) { |
225 # This is here so that all files get recompiled after a clang roll and | 242 # This is here so that all files get recompiled after a clang roll and |
226 # when turning clang on or off. (defines are passed via the command line, | 243 # when turning clang on or off. (defines are passed via the command line, |
227 # and build system rebuild things when their commandline changes). Nothing | 244 # and build system rebuild things when their commandline changes). Nothing |
228 # should ever read this define. | 245 # should ever read this define. |
229 defines += | 246 defines += [ "CR_CLANG_REVISION=$clang_revision" ] |
230 [ "CR_CLANG_REVISION=" + exec_script("//tools/clang/scripts/update.py", | |
231 [ "--print-revision" ], | |
232 "trim string") ] | |
233 } | 247 } |
234 | 248 |
235 # Non-Mac Posix compiler flags setup. | 249 # Non-Mac Posix compiler flags setup. |
236 # ----------------------------------- | 250 # ----------------------------------- |
237 if (is_posix && !(is_mac || is_ios)) { | 251 if (is_posix && !(is_mac || is_ios)) { |
238 if (enable_profiling && !is_debug) { | 252 if (enable_profiling && !is_debug) { |
239 cflags += [ | 253 cflags += [ |
240 "-fno-omit-frame-pointer", | 254 "-fno-omit-frame-pointer", |
241 "-g", | 255 "-g", |
242 ] | 256 ] |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 # NaCl's Clang compiler and Chrome's hermetic Clang compiler will almost | 981 # NaCl's Clang compiler and Chrome's hermetic Clang compiler will almost |
968 # always have different versions. Certain flags may not be recognized by | 982 # always have different versions. Certain flags may not be recognized by |
969 # one version or the other. | 983 # one version or the other. |
970 if (!is_nacl) { | 984 if (!is_nacl) { |
971 # Flags NaCl (Clang 3.7) does not recognize. | 985 # Flags NaCl (Clang 3.7) does not recognize. |
972 cflags += [ | 986 cflags += [ |
973 # TODO(thakis): Enable this, crbug.com/507717 | 987 # TODO(thakis): Enable this, crbug.com/507717 |
974 "-Wno-shift-negative-value", | 988 "-Wno-shift-negative-value", |
975 ] | 989 ] |
976 | 990 |
977 if (exec_script("//tools/clang/scripts/update.py", | 991 if (llvm_force_head_revision) { |
978 [ "--print-revision" ], | |
979 "trim string") != "266460-1") { | |
980 cflags += [ | 992 cflags += [ |
981 # TODO(thakis): https://crbug.com/604888 | 993 # TODO(thakis): https://crbug.com/604888 |
982 "-Wno-undefined-var-template", | 994 "-Wno-undefined-var-template", |
983 ] | 995 ] |
984 } | 996 } |
985 } | 997 } |
986 } | 998 } |
987 } | 999 } |
988 | 1000 |
989 # chromium_code --------------------------------------------------------------- | 1001 # chromium_code --------------------------------------------------------------- |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1427 | 1439 |
1428 if (is_ios || is_mac) { | 1440 if (is_ios || is_mac) { |
1429 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1441 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
1430 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1442 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
1431 config("enable_arc") { | 1443 config("enable_arc") { |
1432 common_flags = [ "-fobjc-arc" ] | 1444 common_flags = [ "-fobjc-arc" ] |
1433 cflags_objc = common_flags | 1445 cflags_objc = common_flags |
1434 cflags_objcc = common_flags | 1446 cflags_objcc = common_flags |
1435 } | 1447 } |
1436 } | 1448 } |
OLD | NEW |