Chromium Code Reviews| 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 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1368 # The NaCl IRT is a special case and always wants its own config. | 1368 # The NaCl IRT is a special case and always wants its own config. |
| 1369 # Various components do: | 1369 # Various components do: |
| 1370 # if (!is_debug) { | 1370 # if (!is_debug) { |
| 1371 # configs -= [ "//build/config/compiler:default_optimization" ] | 1371 # configs -= [ "//build/config/compiler:default_optimization" ] |
| 1372 # configs += [ "//build/config/compiler:optimize_max" ] | 1372 # configs += [ "//build/config/compiler:optimize_max" ] |
| 1373 # } | 1373 # } |
| 1374 # So this config has to have the selection logic just like | 1374 # So this config has to have the selection logic just like |
| 1375 # "default_optimization", below. | 1375 # "default_optimization", below. |
| 1376 configs = [ "//build/config/nacl:irt_optimize" ] | 1376 configs = [ "//build/config/nacl:irt_optimize" ] |
| 1377 } else { | 1377 } else { |
| 1378 ldflags = common_optimize_on_ldflags | 1378 ldflags = common_optimize_on_ldflags |
|
Michael Achenbach
2016/06/20 11:38:25
Don't we miss the common_optimize_on_ldflags if we
Dirk Pranke
2016/06/20 16:34:02
Whoops, yes. Good catch. Will fix.
| |
| 1379 if (is_win) { | 1379 if (is_win) { |
| 1380 # Favor speed over size, /O2 must be before the common flags. The GYP | 1380 # Favor speed over size, /O2 must be before the common flags. The GYP |
| 1381 # build also specifies /Ot, /Oi, and /GF, but these are implied by /O2. | 1381 # build also specifies /Ot, /Oi, and /GF, but these are implied by /O2. |
| 1382 cflags = [ "/O2" ] + common_optimize_on_cflags | 1382 cflags = [ "/O2" ] + common_optimize_on_cflags |
| 1383 | 1383 |
| 1384 # TODO(thakis): Remove is_clang here, https://crbug.com/598772 | 1384 # TODO(thakis): Remove is_clang here, https://crbug.com/598772 |
| 1385 if (is_official_build && !is_clang) { | 1385 if (is_official_build && !is_clang) { |
| 1386 cflags += [ | 1386 cflags += [ |
| 1387 "/GL", # Whole program optimization. | 1387 "/GL", # Whole program optimization. |
| 1388 | 1388 |
| 1389 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO builds. | 1389 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO builds. |
| 1390 # Probably anything that this would catch that wouldn't be caught in a | 1390 # Probably anything that this would catch that wouldn't be caught in a |
| 1391 # normal build isn't going to actually be a bug, so the incremental | 1391 # normal build isn't going to actually be a bug, so the incremental |
| 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 should be used carefully by people who know | |
| 1405 # exactly what they want; nearly every component should use "optimize_max" | |
| 1406 # instead. | |
| 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_posix_target_for_speed") { | |
| 1410 cflags = [ "-O3" ] + common_optimize_on_cflags | |
| 1411 } | |
| 1412 | |
| 1402 # The default optimization applied to all targets. This will be equivalent to | 1413 # The default optimization applied to all targets. This will be equivalent to |
| 1403 # either "optimize" or "no_optimize", depending on the build flags. | 1414 # either "optimize" or "no_optimize", depending on the build flags. |
| 1404 config("default_optimization") { | 1415 config("default_optimization") { |
| 1405 if (is_nacl_irt) { | 1416 if (is_nacl_irt) { |
| 1406 # The NaCl IRT is a special case and always wants its own config. | 1417 # 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. | 1418 # It gets optimized the same way regardless of the type of build. |
| 1408 configs = [ "//build/config/nacl:irt_optimize" ] | 1419 configs = [ "//build/config/nacl:irt_optimize" ] |
| 1409 } else if (is_debug) { | 1420 } else if (is_debug) { |
| 1410 configs = [ ":no_optimize" ] | 1421 configs = [ ":no_optimize" ] |
| 1411 } else { | 1422 } else { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1501 | 1512 |
| 1502 if (is_ios || is_mac) { | 1513 if (is_ios || is_mac) { |
| 1503 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1514 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
| 1504 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1515 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
| 1505 config("enable_arc") { | 1516 config("enable_arc") { |
| 1506 common_flags = [ "-fobjc-arc" ] | 1517 common_flags = [ "-fobjc-arc" ] |
| 1507 cflags_objc = common_flags | 1518 cflags_objc = common_flags |
| 1508 cflags_objcc = common_flags | 1519 cflags_objcc = common_flags |
| 1509 } | 1520 } |
| 1510 } | 1521 } |
| OLD | NEW |