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/gcc/gcc_version.gni") | |
5 import("//build/config/android/config.gni") | 6 import("//build/config/android/config.gni") |
6 if (cpu_arch == "arm") { | 7 if (cpu_arch == "arm") { |
7 import("//build/config/arm.gni") | 8 import("//build/config/arm.gni") |
8 } | 9 } |
9 | 10 |
10 declare_args() { | 11 declare_args() { |
11 # Normally, Android builds are lightly optimized, even for debug builds, to | 12 # Normally, Android builds are lightly optimized, even for debug builds, to |
12 # keep binary size down. Setting this flag to true disables such optimization | 13 # keep binary size down. Setting this flag to true disables such optimization |
13 android_full_debug = false | 14 android_full_debug = false |
14 } | 15 } |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 ] | 208 ] |
208 } | 209 } |
209 | 210 |
210 # Android-specific flags setup. | 211 # Android-specific flags setup. |
211 # ----------------------------- | 212 # ----------------------------- |
212 if (is_android) { | 213 if (is_android) { |
213 cflags += [ | 214 cflags += [ |
214 "-ffunction-sections", | 215 "-ffunction-sections", |
215 "-funwind-tables", | 216 "-funwind-tables", |
216 "-fno-short-enums", | 217 "-fno-short-enums", |
218 | |
brettw
2014/05/16 16:54:21
Got extra blank in here.
Fabrice (no longer in Chrome)
2014/05/16 17:08:24
Done.
| |
217 ] | 219 ] |
218 if (!is_clang) { | 220 if (!is_clang) { |
219 # Clang doesn't support this one. | 221 # Clang doesn't support these flags. |
220 cflags += [ "-finline-limit=64" ] | 222 cflags += [ |
223 "-finline-limit=64", | |
224 # The following 6 options are disabled to save on | |
225 # binary size in gcc 4.8. | |
226 # TODO(fdegans) Reevaluate when we upgrade GCC. | |
227 "-fno-partial-inlining", | |
228 "-fno-early-inlining", | |
229 "-fno-tree-copy-prop", | |
230 "-fno-tree-loop-optimize", | |
231 "-fno-move-loop-invariants", | |
232 "-fno-caller-saves", | |
233 ] | |
221 } | 234 } |
222 if (is_android_webview_build) { | 235 if (is_android_webview_build) { |
223 # Android predefines this as 1; undefine it here so Chromium can redefine | 236 # Android predefines this as 1; undefine it here so Chromium can redefine |
224 # it later to be 2 for chromium code and unset for third party code. This | 237 # it later to be 2 for chromium code and unset for third party code. This |
225 # works because cflags are added before defines. | 238 # works because cflags are added before defines. |
226 # TODO(brettw) the above comment seems incorrect. We specify defines | 239 # TODO(brettw) the above comment seems incorrect. We specify defines |
227 # before cflags on our compiler command lines. | 240 # before cflags on our compiler command lines. |
228 cflags += [ "-U_FORTIFY_SOURCE" ] | 241 cflags += [ "-U_FORTIFY_SOURCE" ] |
229 } | 242 } |
230 | 243 |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
602 # Disabling c++0x-compat should be handled in WebKit, but | 615 # Disabling c++0x-compat should be handled in WebKit, but |
603 # this currently doesn't work because gcc_version is not set | 616 # this currently doesn't work because gcc_version is not set |
604 # correctly when building with the Android build system. | 617 # correctly when building with the Android build system. |
605 # TODO(torne): Fix this in WebKit. | 618 # TODO(torne): Fix this in WebKit. |
606 "-Wno-error=c++0x-compat", | 619 "-Wno-error=c++0x-compat", |
607 # Other things unrelated to -Wextra: | 620 # Other things unrelated to -Wextra: |
608 "-Wno-non-virtual-dtor", | 621 "-Wno-non-virtual-dtor", |
609 "-Wno-sign-promo", | 622 "-Wno-sign-promo", |
610 ] | 623 ] |
611 } | 624 } |
625 | |
626 if (gcc_version >= 48) { | |
627 # Don't warn about the "typedef 'foo' locally defined but not used" | |
628 # for gcc 4.8. | |
629 # TODO: remove this flag once all builds work. See crbug.com/227506 | |
630 cflags += [ | |
631 "-Wno-unused-local-typedefs", | |
632 ] | |
633 } | |
612 } | 634 } |
613 } | 635 } |
614 | 636 |
615 # This will generate warnings when using Clang if code generates exit-time | 637 # This will generate warnings when using Clang if code generates exit-time |
616 # destructors, which will slow down closing the program. | 638 # destructors, which will slow down closing the program. |
617 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600 | 639 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600 |
618 config("wexit_time_destructors") { | 640 config("wexit_time_destructors") { |
619 if (is_clang) { | 641 if (is_clang) { |
620 cflags = [ "-Wexit-time-destructors" ] | 642 cflags = [ "-Wexit-time-destructors" ] |
621 } | 643 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
744 } else { | 766 } else { |
745 cflags = [ "-g1" ] | 767 cflags = [ "-g1" ] |
746 } | 768 } |
747 } | 769 } |
748 | 770 |
749 config("no_symbols") { | 771 config("no_symbols") { |
750 if (!is_win) { | 772 if (!is_win) { |
751 cflags = [ "-g0" ] | 773 cflags = [ "-g0" ] |
752 } | 774 } |
753 } | 775 } |
754 | |
OLD | NEW |