| 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 if (current_cpu == "arm") { | 6 if (current_cpu == "arm") { |
| 7 import("//build/config/arm.gni") | 7 import("//build/config/arm.gni") |
| 8 } | 8 } |
| 9 if (current_cpu == "mipsel" || current_cpu == "mips64el") { | 9 if (current_cpu == "mipsel" || current_cpu == "mips64el") { |
| 10 import("//build/config/mips.gni") | 10 import("//build/config/mips.gni") |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 common_optimize_on_ldflags += [ "-Wl,--as-needed" ] | 713 common_optimize_on_ldflags += [ "-Wl,--as-needed" ] |
| 714 } | 714 } |
| 715 } | 715 } |
| 716 } | 716 } |
| 717 | 717 |
| 718 # Default "optimization on" config. On Windows, this favors size over speed. | 718 # Default "optimization on" config. On Windows, this favors size over speed. |
| 719 config("optimize") { | 719 config("optimize") { |
| 720 if (is_win) { | 720 if (is_win) { |
| 721 # Favor size over speed, /O1 must be before the common flags. The GYP | 721 # Favor size over speed, /O1 must be before the common flags. The GYP |
| 722 # build also specifies /Os and /GF but these are implied by /O1. | 722 # build also specifies /Os and /GF but these are implied by /O1. |
| 723 cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ] | 723 cflags = [ "/O2" ] + common_optimize_on_cflags + [ "/Oi" ] |
| 724 } else if (is_android) { | 724 } else if (is_android) { |
| 725 cflags = [ "-Os" ] + common_optimize_on_cflags # Favor size over speed. | 725 cflags = [ "-Os" ] + common_optimize_on_cflags # Favor size over speed. |
| 726 } else { | 726 } else { |
| 727 cflags = [ "-O3" ] + common_optimize_on_cflags | 727 cflags = [ "-O3" ] + common_optimize_on_cflags |
| 728 } | 728 } |
| 729 ldflags = common_optimize_on_ldflags | 729 ldflags = common_optimize_on_ldflags |
| 730 } | 730 } |
| 731 | 731 |
| 732 # Turn off optimizations. | 732 # Turn off optimizations. |
| 733 config("no_optimize") { | 733 config("no_optimize") { |
| 734 if (is_win) { | 734 if (is_win) { |
| 735 cflags = [ | 735 cflags = [ |
| 736 "/Od", # Disable optimization. | 736 "/O2", # Do some optimizations. |
| 737 "/Oy-", # Disable omitting frame pointers, must be after /O2. |
| 737 "/Ob0", # Disable all inlining (on by default). | 738 "/Ob0", # Disable all inlining (on by default). |
| 738 "/RTC1", # Runtime checks for stack frame and uninitialized variables. | |
| 739 ] | 739 ] |
| 740 } else if (is_android) { | 740 } else if (is_android) { |
| 741 # On Android we kind of optimize some things that don't affect debugging | 741 # On Android we kind of optimize some things that don't affect debugging |
| 742 # much even when optimization is disabled to get the binary size down. | 742 # much even when optimization is disabled to get the binary size down. |
| 743 cflags = [ | 743 cflags = [ |
| 744 "-Os", | 744 "-Os", |
| 745 "-fdata-sections", | 745 "-fdata-sections", |
| 746 "-ffunction-sections", | 746 "-ffunction-sections", |
| 747 ] | 747 ] |
| 748 ldflags = common_optimize_on_ldflags | 748 ldflags = common_optimize_on_ldflags |
| (...skipping 17 matching lines...) Expand all Loading... |
| 766 cflags = [ "/Zi" ] # Produce PDB file, no edit and continue. | 766 cflags = [ "/Zi" ] # Produce PDB file, no edit and continue. |
| 767 } | 767 } |
| 768 ldflags = [ "/DEBUG" ] | 768 ldflags = [ "/DEBUG" ] |
| 769 } else { | 769 } else { |
| 770 cflags = [ | 770 cflags = [ |
| 771 "-g3", | 771 "-g3", |
| 772 "-ggdb3", | 772 "-ggdb3", |
| 773 ] | 773 ] |
| 774 } | 774 } |
| 775 } | 775 } |
| OLD | NEW |