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

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

Issue 2078223002: Add a dedicated "optimize_speed" config to GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update w/ review feedback, call it "optimize_speed" instead and make it cross-platform Created 4 years, 6 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 | third_party/opus/BUILD.gn » ('j') | 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 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 # value of C4702 for PGO builds is likely very small. 1392 # value of C4702 for PGO builds is likely very small.
1393 "/wd4702", 1393 "/wd4702",
1394 ] 1394 ]
1395 } 1395 }
1396 } else { 1396 } else {
1397 cflags = [ "-O2" ] + common_optimize_on_cflags 1397 cflags = [ "-O2" ] + common_optimize_on_cflags
1398 } 1398 }
1399 } 1399 }
1400 } 1400 }
1401 1401
1402 # This config can be used to override the default settings for per-component
1403 # and whole-program optimization, optimizing the particular target for speed
1404 # instead of code size. This config is exactly the same as "optimize_max"
1405 # except that we use -O3 instead of -O2 on non-win, non-IRT platforms.
1406 #
1407 # TODO(crbug.com/621335) - rework how all of these configs are related
1408 # so that we don't need this disclaimer.
1409 config("optimize_speed") {
Nico 2016/06/21 18:10:37 bikeshed: I think it'd be good if the name contain
1410 if (is_nacl_irt) {
1411 # The NaCl IRT is a special case and always wants its own config.
1412 # Various components do:
1413 # if (!is_debug) {
1414 # configs -= [ "//build/config/compiler:default_optimization" ]
1415 # configs += [ "//build/config/compiler:optimize_max" ]
1416 # }
1417 # So this config has to have the selection logic just like
1418 # "default_optimization", below.
1419 configs = [ "//build/config/nacl:irt_optimize" ]
1420 } else {
1421 ldflags = common_optimize_on_ldflags
1422 if (is_win) {
1423 # Favor speed over size, /O2 must be before the common flags. The GYP
1424 # build also specifies /Ot, /Oi, and /GF, but these are implied by /O2.
1425 cflags = [ "/O2" ] + common_optimize_on_cflags
1426
1427 # TODO(thakis): Remove is_clang here, https://crbug.com/598772
1428 if (is_official_build && !is_clang) {
1429 cflags += [
1430 "/GL", # Whole program optimization.
1431
1432 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO builds.
1433 # Probably anything that this would catch that wouldn't be caught in a
1434 # normal build isn't going to actually be a bug, so the incremental
1435 # value of C4702 for PGO builds is likely very small.
1436 "/wd4702",
1437 ]
Nico 2016/06/21 18:10:37 this is a lot of copy-pasta :-/
1438 }
1439 } else {
1440 cflags = [ "-O3" ] + common_optimize_on_cflags
1441 }
1442 }
1443 }
1444
1402 # The default optimization applied to all targets. This will be equivalent to 1445 # The default optimization applied to all targets. This will be equivalent to
1403 # either "optimize" or "no_optimize", depending on the build flags. 1446 # either "optimize" or "no_optimize", depending on the build flags.
1404 config("default_optimization") { 1447 config("default_optimization") {
1405 if (is_nacl_irt) { 1448 if (is_nacl_irt) {
1406 # The NaCl IRT is a special case and always wants its own config. 1449 # The NaCl IRT is a special case and always wants its own config.
1407 # It gets optimized the same way regardless of the type of build. 1450 # It gets optimized the same way regardless of the type of build.
1408 configs = [ "//build/config/nacl:irt_optimize" ] 1451 configs = [ "//build/config/nacl:irt_optimize" ]
1409 } else if (is_debug) { 1452 } else if (is_debug) {
1410 configs = [ ":no_optimize" ] 1453 configs = [ ":no_optimize" ]
1411 } else { 1454 } else {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 1544
1502 if (is_ios || is_mac) { 1545 if (is_ios || is_mac) {
1503 # On Mac and iOS, this enables support for ARC (automatic ref-counting). 1546 # On Mac and iOS, this enables support for ARC (automatic ref-counting).
1504 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. 1547 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html.
1505 config("enable_arc") { 1548 config("enable_arc") {
1506 common_flags = [ "-fobjc-arc" ] 1549 common_flags = [ "-fobjc-arc" ]
1507 cflags_objc = common_flags 1550 cflags_objc = common_flags
1508 cflags_objcc = common_flags 1551 cflags_objcc = common_flags
1509 } 1552 }
1510 } 1553 }
OLDNEW
« no previous file with comments | « no previous file | third_party/opus/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698