| 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 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1343 | 1343 |
| 1344 # Same config as 'optimize' but without the WPO flag. | 1344 # Same config as 'optimize' but without the WPO flag. |
| 1345 config("optimize_no_wpo") { | 1345 config("optimize_no_wpo") { |
| 1346 if (is_win) { | 1346 if (is_win) { |
| 1347 # Favor size over speed, /O1 must be before the common flags. The GYP | 1347 # Favor size over speed, /O1 must be before the common flags. The GYP |
| 1348 # build also specifies /Os and /GF but these are implied by /O1. | 1348 # build also specifies /Os and /GF but these are implied by /O1. |
| 1349 cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ] | 1349 cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ] |
| 1350 } else if (optimize_for_size) { | 1350 } else if (optimize_for_size) { |
| 1351 # Favor size over speed. | 1351 # Favor size over speed. |
| 1352 cflags = [ "-Os" ] + common_optimize_on_cflags | 1352 cflags = [ "-Os" ] + common_optimize_on_cflags |
| 1353 } else if (optimize_for_fuzzing) { |
| 1354 cflags = [ "-O1" ] + common_optimize_on_cflags |
| 1353 } else { | 1355 } else { |
| 1354 cflags = [ "-O2" ] + common_optimize_on_cflags | 1356 cflags = [ "-O2" ] + common_optimize_on_cflags |
| 1355 } | 1357 } |
| 1356 ldflags = common_optimize_on_ldflags | 1358 ldflags = common_optimize_on_ldflags |
| 1357 } | 1359 } |
| 1358 | 1360 |
| 1359 # Turn off optimizations. | 1361 # Turn off optimizations. |
| 1360 config("no_optimize") { | 1362 config("no_optimize") { |
| 1361 if (is_win) { | 1363 if (is_win) { |
| 1362 cflags = [ | 1364 cflags = [ |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1456 # value of C4702 for PGO builds is likely very small. | 1458 # value of C4702 for PGO builds is likely very small. |
| 1457 "/wd4702", | 1459 "/wd4702", |
| 1458 ] | 1460 ] |
| 1459 } | 1461 } |
| 1460 } else { | 1462 } else { |
| 1461 cflags = [ "-O3" ] + common_optimize_on_cflags | 1463 cflags = [ "-O3" ] + common_optimize_on_cflags |
| 1462 } | 1464 } |
| 1463 } | 1465 } |
| 1464 } | 1466 } |
| 1465 | 1467 |
| 1468 config("optimize_fuzzing") { |
| 1469 if (is_nacl_irt) { |
| 1470 # The NaCl IRT is a special case and always wants its own config. |
| 1471 # Various components do: |
| 1472 # if (!is_debug) { |
| 1473 # configs -= [ "//build/config/compiler:default_optimization" ] |
| 1474 # configs += [ "//build/config/compiler:optimize_max" ] |
| 1475 # } |
| 1476 # So this config has to have the selection logic just like |
| 1477 # "default_optimization", below. |
| 1478 configs = [ "//build/config/nacl:irt_optimize" ] |
| 1479 } else { |
| 1480 # Only supported on non-Windows. |
| 1481 assert(!is_win) |
| 1482 cflags = [ "-O1" ] + common_optimize_on_cflags |
| 1483 ldflags = common_optimize_on_ldflags |
| 1484 } |
| 1485 } |
| 1486 |
| 1466 # The default optimization applied to all targets. This will be equivalent to | 1487 # The default optimization applied to all targets. This will be equivalent to |
| 1467 # either "optimize" or "no_optimize", depending on the build flags. | 1488 # either "optimize" or "no_optimize", depending on the build flags. |
| 1468 config("default_optimization") { | 1489 config("default_optimization") { |
| 1469 if (is_nacl_irt) { | 1490 if (is_nacl_irt) { |
| 1470 # The NaCl IRT is a special case and always wants its own config. | 1491 # The NaCl IRT is a special case and always wants its own config. |
| 1471 # It gets optimized the same way regardless of the type of build. | 1492 # It gets optimized the same way regardless of the type of build. |
| 1472 configs = [ "//build/config/nacl:irt_optimize" ] | 1493 configs = [ "//build/config/nacl:irt_optimize" ] |
| 1473 } else if (is_debug) { | 1494 } else if (is_debug) { |
| 1474 configs = [ ":no_optimize" ] | 1495 configs = [ ":no_optimize" ] |
| 1496 } else if (optimize_for_fuzzing) { |
| 1497 configs = [ ":optimize_fuzzing" ] |
| 1475 } else { | 1498 } else { |
| 1476 configs = [ ":optimize" ] | 1499 configs = [ ":optimize" ] |
| 1477 } | 1500 } |
| 1478 } | 1501 } |
| 1479 | 1502 |
| 1480 # Symbols ---------------------------------------------------------------------- | 1503 # Symbols ---------------------------------------------------------------------- |
| 1481 | 1504 |
| 1482 # The BUILDCONFIG file sets the "default_symbols" config on targets by | 1505 # The BUILDCONFIG file sets the "default_symbols" config on targets by |
| 1483 # default. It will be equivalent to one the three specific symbol levels. | 1506 # default. It will be equivalent to one the three specific symbol levels. |
| 1484 # | 1507 # |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1588 | 1611 |
| 1589 if (is_ios || is_mac) { | 1612 if (is_ios || is_mac) { |
| 1590 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1613 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
| 1591 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1614 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
| 1592 config("enable_arc") { | 1615 config("enable_arc") { |
| 1593 common_flags = [ "-fobjc-arc" ] | 1616 common_flags = [ "-fobjc-arc" ] |
| 1594 cflags_objc = common_flags | 1617 cflags_objc = common_flags |
| 1595 cflags_objcc = common_flags | 1618 cflags_objcc = common_flags |
| 1596 } | 1619 } |
| 1597 } | 1620 } |
| OLD | NEW |