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 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1353 | 1353 |
1354 # Same config as 'optimize' but without the WPO flag. | 1354 # Same config as 'optimize' but without the WPO flag. |
1355 config("optimize_no_wpo") { | 1355 config("optimize_no_wpo") { |
1356 if (is_win) { | 1356 if (is_win) { |
1357 # Favor size over speed, /O1 must be before the common flags. The GYP | 1357 # Favor size over speed, /O1 must be before the common flags. The GYP |
1358 # build also specifies /Os and /GF but these are implied by /O1. | 1358 # build also specifies /Os and /GF but these are implied by /O1. |
1359 cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ] | 1359 cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ] |
1360 } else if (optimize_for_size) { | 1360 } else if (optimize_for_size) { |
1361 # Favor size over speed. | 1361 # Favor size over speed. |
1362 cflags = [ "-Os" ] + common_optimize_on_cflags | 1362 cflags = [ "-Os" ] + common_optimize_on_cflags |
| 1363 } else if (optimize_for_fuzzing) { |
| 1364 cflags = [ "-O1" ] + common_optimize_on_cflags |
1363 } else { | 1365 } else { |
1364 cflags = [ "-O2" ] + common_optimize_on_cflags | 1366 cflags = [ "-O2" ] + common_optimize_on_cflags |
1365 } | 1367 } |
1366 ldflags = common_optimize_on_ldflags | 1368 ldflags = common_optimize_on_ldflags |
1367 } | 1369 } |
1368 | 1370 |
1369 # Turn off optimizations. | 1371 # Turn off optimizations. |
1370 config("no_optimize") { | 1372 config("no_optimize") { |
1371 if (is_win) { | 1373 if (is_win) { |
1372 cflags = [ | 1374 cflags = [ |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1409 cflags += [ | 1411 cflags += [ |
1410 "/GL", # Whole program optimization. | 1412 "/GL", # Whole program optimization. |
1411 | 1413 |
1412 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO builds. | 1414 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO builds. |
1413 # Probably anything that this would catch that wouldn't be caught in a | 1415 # Probably anything that this would catch that wouldn't be caught in a |
1414 # normal build isn't going to actually be a bug, so the incremental | 1416 # normal build isn't going to actually be a bug, so the incremental |
1415 # value of C4702 for PGO builds is likely very small. | 1417 # value of C4702 for PGO builds is likely very small. |
1416 "/wd4702", | 1418 "/wd4702", |
1417 ] | 1419 ] |
1418 } | 1420 } |
| 1421 } else if (optimize_for_fuzzing) { |
| 1422 cflags = [ "-O1" ] + common_optimize_on_cflags |
1419 } else { | 1423 } else { |
1420 cflags = [ "-O2" ] + common_optimize_on_cflags | 1424 cflags = [ "-O2" ] + common_optimize_on_cflags |
1421 } | 1425 } |
1422 } | 1426 } |
1423 } | 1427 } |
1424 | 1428 |
1425 # This config can be used to override the default settings for per-component | 1429 # This config can be used to override the default settings for per-component |
1426 # and whole-program optimization, optimizing the particular target for speed | 1430 # and whole-program optimization, optimizing the particular target for speed |
1427 # instead of code size. This config is exactly the same as "optimize_max" | 1431 # instead of code size. This config is exactly the same as "optimize_max" |
1428 # except that we use -O3 instead of -O2 on non-win, non-IRT platforms. | 1432 # except that we use -O3 instead of -O2 on non-win, non-IRT platforms. |
(...skipping 23 matching lines...) Expand all Loading... |
1452 cflags += [ | 1456 cflags += [ |
1453 "/GL", # Whole program optimization. | 1457 "/GL", # Whole program optimization. |
1454 | 1458 |
1455 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO builds. | 1459 # Disable Warning 4702 ("Unreachable code") for the WPO/PGO builds. |
1456 # Probably anything that this would catch that wouldn't be caught in a | 1460 # Probably anything that this would catch that wouldn't be caught in a |
1457 # normal build isn't going to actually be a bug, so the incremental | 1461 # normal build isn't going to actually be a bug, so the incremental |
1458 # value of C4702 for PGO builds is likely very small. | 1462 # value of C4702 for PGO builds is likely very small. |
1459 "/wd4702", | 1463 "/wd4702", |
1460 ] | 1464 ] |
1461 } | 1465 } |
| 1466 } else if (optimize_for_fuzzing) { |
| 1467 cflags = [ "-O1" ] + common_optimize_on_cflags |
1462 } else { | 1468 } else { |
1463 cflags = [ "-O3" ] + common_optimize_on_cflags | 1469 cflags = [ "-O3" ] + common_optimize_on_cflags |
1464 } | 1470 } |
1465 } | 1471 } |
1466 } | 1472 } |
1467 | 1473 |
1468 config("optimize_fuzzing") { | 1474 config("optimize_fuzzing") { |
1469 cflags = [ "-O1" ] + common_optimize_on_cflags | 1475 cflags = [ "-O1" ] + common_optimize_on_cflags |
1470 ldflags = common_optimize_on_ldflags | 1476 ldflags = common_optimize_on_ldflags |
1471 visibility = [ ":default_optimization" ] | 1477 visibility = [ ":default_optimization" ] |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1611 | 1617 |
1612 if (is_ios || is_mac) { | 1618 if (is_ios || is_mac) { |
1613 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1619 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
1614 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1620 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
1615 config("enable_arc") { | 1621 config("enable_arc") { |
1616 common_flags = [ "-fobjc-arc" ] | 1622 common_flags = [ "-fobjc-arc" ] |
1617 cflags_objc = common_flags | 1623 cflags_objc = common_flags |
1618 cflags_objcc = common_flags | 1624 cflags_objcc = common_flags |
1619 } | 1625 } |
1620 } | 1626 } |
OLD | NEW |