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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 msvs_xtree_patched = false | 73 msvs_xtree_patched = false |
74 } | 74 } |
75 | 75 |
76 # Omit unwind support in official builds to save space. | 76 # Omit unwind support in official builds to save space. |
77 # We can use breakpad for these builds. | 77 # We can use breakpad for these builds. |
78 exclude_unwind_tables = is_chrome_branded && is_official_build | 78 exclude_unwind_tables = is_chrome_branded && is_official_build |
79 | 79 |
80 # If true, gold linker will save symbol table inside object files. | 80 # If true, gold linker will save symbol table inside object files. |
81 # This speeds up gdb startup by 60% | 81 # This speeds up gdb startup by 60% |
82 gdb_index = false | 82 gdb_index = false |
83 | |
84 # If true, optimize for size. Does not affect windows builds. | |
85 optimize_for_size = is_android || is_ios | |
83 } | 86 } |
84 | 87 |
85 # Apply the default logic for these values if they were not set explicitly. | 88 # Apply the default logic for these values if they were not set explicitly. |
86 if (gold_path == false) { | 89 if (gold_path == false) { |
87 if (use_gold) { | 90 if (use_gold) { |
88 gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", | 91 gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", |
89 root_build_dir) | 92 root_build_dir) |
90 } else { | 93 } else { |
91 gold_path = "" | 94 gold_path = "" |
92 } | 95 } |
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1202 } | 1205 } |
1203 } | 1206 } |
1204 } | 1207 } |
1205 | 1208 |
1206 # Default "optimization on" config. | 1209 # Default "optimization on" config. |
1207 config("optimize") { | 1210 config("optimize") { |
1208 if (is_win) { | 1211 if (is_win) { |
1209 # Favor size over speed, /O1 must be before the common flags. The GYP | 1212 # Favor size over speed, /O1 must be before the common flags. The GYP |
1210 # build also specifies /Os and /GF but these are implied by /O1. | 1213 # build also specifies /Os and /GF but these are implied by /O1. |
1211 cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ] | 1214 cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ] |
1212 } else if (is_android || is_ios) { | 1215 } else if (optimize_for_size) { |
1213 # Favor size over speed. | 1216 # Favor size over speed. |
1214 cflags = [ "-Os" ] + common_optimize_on_cflags | 1217 cflags = [ "-Os" ] + common_optimize_on_cflags |
1215 } else { | 1218 } else { |
1216 # Linux & Mac favor speed over size. | 1219 # Linux & Mac favor speed over size. |
slan
2016/04/12 20:50:19
nit: It might make more sense now to move this com
bcf
2016/04/12 20:54:38
Done.
| |
1217 # TODO(brettw) it's weird that Mac and desktop Linux are different. We shoul d | 1220 # TODO(brettw) it's weird that Mac and desktop Linux are different. We shoul d |
1218 # explore favoring size over speed in this case as well. | 1221 # explore favoring size over speed in this case as well. |
1219 cflags = [ "-O2" ] + common_optimize_on_cflags | 1222 cflags = [ "-O2" ] + common_optimize_on_cflags |
1220 } | 1223 } |
1221 ldflags = common_optimize_on_ldflags | 1224 ldflags = common_optimize_on_ldflags |
1222 } | 1225 } |
1223 | 1226 |
1224 # Turn off optimizations. | 1227 # Turn off optimizations. |
1225 config("no_optimize") { | 1228 config("no_optimize") { |
1226 if (is_win) { | 1229 if (is_win) { |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1397 | 1400 |
1398 if (is_ios || is_mac) { | 1401 if (is_ios || is_mac) { |
1399 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1402 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
1400 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1403 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
1401 config("enable_arc") { | 1404 config("enable_arc") { |
1402 common_flags = [ "-fobjc-arc" ] | 1405 common_flags = [ "-fobjc-arc" ] |
1403 cflags_objc = common_flags | 1406 cflags_objc = common_flags |
1404 cflags_objcc = common_flags | 1407 cflags_objcc = common_flags |
1405 } | 1408 } |
1406 } | 1409 } |
OLD | NEW |