Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: build/config/compiler/BUILD.gn

Issue 1916423003: Add a new 'optimize_no_wpo' compiler config to GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 # that some libraries aren't needed when they actually are, 1205 # that some libraries aren't needed when they actually are,
1206 # http://crbug.com/234010. As workaround, disable --as-needed. 1206 # http://crbug.com/234010. As workaround, disable --as-needed.
1207 common_optimize_on_ldflags += [ "-Wl,--as-needed" ] 1207 common_optimize_on_ldflags += [ "-Wl,--as-needed" ]
1208 } 1208 }
1209 } 1209 }
1210 } 1210 }
1211 1211
1212 # Default "optimization on" config. 1212 # Default "optimization on" config.
1213 config("optimize") { 1213 config("optimize") {
1214 if (is_win) { 1214 if (is_win) {
1215 # TODO(sebmarchand): Enable this once we've decided to ship with full WPO
1216 # and when the change to the incompatible projects (FFmpeg and Yasm) have
1217 # have been committed.
1218 #if (is_official_build) {
1219 # common_optimize_on_cflags += [ "/GL" ]
1220 #}
1221
1222 # Favor size over speed, /O1 must be before the common flags. The GYP
1223 # build also specifies /Os and /GF but these are implied by /O1.
1224 cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ]
1225 } else if (optimize_for_size) {
1226 # Favor size over speed.
1227 cflags = [ "-Os" ] + common_optimize_on_cflags
1228 } else {
1229 cflags = [ "-O2" ] + common_optimize_on_cflags
1230 }
1231 ldflags = common_optimize_on_ldflags
1232 }
1233
1234 # Same config as 'optimize' but without the WPO flag.
1235 config("optimize_no_wpo") {
1236 if (is_win) {
1215 # Favor size over speed, /O1 must be before the common flags. The GYP 1237 # Favor size over speed, /O1 must be before the common flags. The GYP
1216 # build also specifies /Os and /GF but these are implied by /O1. 1238 # build also specifies /Os and /GF but these are implied by /O1.
1217 cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ] 1239 cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ]
1218 } else if (optimize_for_size) { 1240 } else if (optimize_for_size) {
1219 # Favor size over speed. 1241 # Favor size over speed.
1220 cflags = [ "-Os" ] + common_optimize_on_cflags 1242 cflags = [ "-Os" ] + common_optimize_on_cflags
1221 } else { 1243 } else {
1222 cflags = [ "-O2" ] + common_optimize_on_cflags 1244 cflags = [ "-O2" ] + common_optimize_on_cflags
1223 } 1245 }
1224 ldflags = common_optimize_on_ldflags 1246 ldflags = common_optimize_on_ldflags
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 1422
1401 if (is_ios || is_mac) { 1423 if (is_ios || is_mac) {
1402 # On Mac and iOS, this enables support for ARC (automatic ref-counting). 1424 # On Mac and iOS, this enables support for ARC (automatic ref-counting).
1403 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. 1425 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html.
1404 config("enable_arc") { 1426 config("enable_arc") {
1405 common_flags = [ "-fobjc-arc" ] 1427 common_flags = [ "-fobjc-arc" ]
1406 cflags_objc = common_flags 1428 cflags_objc = common_flags
1407 cflags_objcc = common_flags 1429 cflags_objcc = common_flags
1408 } 1430 }
1409 } 1431 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698