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 (cpu_arch == "arm") { | 6 if (cpu_arch == "arm") { |
7 import("//build/config/arm.gni") | 7 import("//build/config/arm.gni") |
8 } | 8 } |
9 if (is_posix) { | 9 if (is_posix) { |
10 import("//build/config/gcc/gcc_version.gni") | 10 import("//build/config/gcc/gcc_version.gni") |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 212 |
213 # Android-specific flags setup. | 213 # Android-specific flags setup. |
214 # ----------------------------- | 214 # ----------------------------- |
215 if (is_android) { | 215 if (is_android) { |
216 cflags += [ | 216 cflags += [ |
217 "-ffunction-sections", | 217 "-ffunction-sections", |
218 "-funwind-tables", | 218 "-funwind-tables", |
219 "-fno-short-enums", | 219 "-fno-short-enums", |
220 ] | 220 ] |
221 if (!is_clang) { | 221 if (!is_clang) { |
222 # Clang doesn't support these flags. | 222 # Clang doesn't support this one. |
223 cflags += [ | 223 cflags += [ "-finline-limit=64" ] |
224 "-finline-limit=64", | |
225 # The following 6 options are disabled to save on | |
226 # binary size in gcc 4.8. | |
227 # TODO(fdegans) Reevaluate when we upgrade GCC. | |
228 "-fno-partial-inlining", | |
229 "-fno-early-inlining", | |
230 "-fno-tree-copy-prop", | |
231 "-fno-tree-loop-optimize", | |
232 "-fno-move-loop-invariants", | |
233 "-fno-caller-saves", | |
234 ] | |
235 } | 224 } |
236 if (is_android_webview_build) { | 225 if (is_android_webview_build) { |
237 # Android predefines this as 1; undefine it here so Chromium can redefine | 226 # Android predefines this as 1; undefine it here so Chromium can redefine |
238 # it later to be 2 for chromium code and unset for third party code. This | 227 # it later to be 2 for chromium code and unset for third party code. This |
239 # works because cflags are added before defines. | 228 # works because cflags are added before defines. |
240 # TODO(brettw) the above comment seems incorrect. We specify defines | 229 # TODO(brettw) the above comment seems incorrect. We specify defines |
241 # before cflags on our compiler command lines. | 230 # before cflags on our compiler command lines. |
242 cflags += [ "-U_FORTIFY_SOURCE" ] | 231 cflags += [ "-U_FORTIFY_SOURCE" ] |
243 } | 232 } |
244 | 233 |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 # Disabling c++0x-compat should be handled in WebKit, but | 611 # Disabling c++0x-compat should be handled in WebKit, but |
623 # this currently doesn't work because gcc_version is not set | 612 # this currently doesn't work because gcc_version is not set |
624 # correctly when building with the Android build system. | 613 # correctly when building with the Android build system. |
625 # TODO(torne): Fix this in WebKit. | 614 # TODO(torne): Fix this in WebKit. |
626 "-Wno-error=c++0x-compat", | 615 "-Wno-error=c++0x-compat", |
627 # Other things unrelated to -Wextra: | 616 # Other things unrelated to -Wextra: |
628 "-Wno-non-virtual-dtor", | 617 "-Wno-non-virtual-dtor", |
629 "-Wno-sign-promo", | 618 "-Wno-sign-promo", |
630 ] | 619 ] |
631 } | 620 } |
632 | |
633 if (gcc_version >= 48) { | |
634 # Don't warn about the "typedef 'foo' locally defined but not used" | |
635 # for gcc 4.8. | |
636 # TODO: remove this flag once all builds work. See crbug.com/227506 | |
637 cflags += [ | |
638 "-Wno-unused-local-typedefs", | |
639 ] | |
640 } | |
641 } | 621 } |
642 } | 622 } |
643 | 623 |
644 # This will generate warnings when using Clang if code generates exit-time | 624 # This will generate warnings when using Clang if code generates exit-time |
645 # destructors, which will slow down closing the program. | 625 # destructors, which will slow down closing the program. |
646 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600 | 626 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600 |
647 config("wexit_time_destructors") { | 627 config("wexit_time_destructors") { |
648 if (is_clang) { | 628 if (is_clang) { |
649 cflags = [ "-Wexit-time-destructors" ] | 629 cflags = [ "-Wexit-time-destructors" ] |
650 } | 630 } |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 } else { | 769 } else { |
790 cflags = [ "-g1" ] | 770 cflags = [ "-g1" ] |
791 } | 771 } |
792 } | 772 } |
793 | 773 |
794 config("no_symbols") { | 774 config("no_symbols") { |
795 if (!is_win) { | 775 if (!is_win) { |
796 cflags = [ "-g0" ] | 776 cflags = [ "-g0" ] |
797 } | 777 } |
798 } | 778 } |
| 779 |
OLD | NEW |