| 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 this one. | 222 # Clang doesn't support these flags. |
| 223 cflags += [ "-finline-limit=64" ] | 223 cflags += [ |
| 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 ] |
| 224 } | 235 } |
| 225 if (is_android_webview_build) { | 236 if (is_android_webview_build) { |
| 226 # Android predefines this as 1; undefine it here so Chromium can redefine | 237 # Android predefines this as 1; undefine it here so Chromium can redefine |
| 227 # it later to be 2 for chromium code and unset for third party code. This | 238 # it later to be 2 for chromium code and unset for third party code. This |
| 228 # works because cflags are added before defines. | 239 # works because cflags are added before defines. |
| 229 # TODO(brettw) the above comment seems incorrect. We specify defines | 240 # TODO(brettw) the above comment seems incorrect. We specify defines |
| 230 # before cflags on our compiler command lines. | 241 # before cflags on our compiler command lines. |
| 231 cflags += [ "-U_FORTIFY_SOURCE" ] | 242 cflags += [ "-U_FORTIFY_SOURCE" ] |
| 232 } | 243 } |
| 233 | 244 |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 # Disabling c++0x-compat should be handled in WebKit, but | 622 # Disabling c++0x-compat should be handled in WebKit, but |
| 612 # this currently doesn't work because gcc_version is not set | 623 # this currently doesn't work because gcc_version is not set |
| 613 # correctly when building with the Android build system. | 624 # correctly when building with the Android build system. |
| 614 # TODO(torne): Fix this in WebKit. | 625 # TODO(torne): Fix this in WebKit. |
| 615 "-Wno-error=c++0x-compat", | 626 "-Wno-error=c++0x-compat", |
| 616 # Other things unrelated to -Wextra: | 627 # Other things unrelated to -Wextra: |
| 617 "-Wno-non-virtual-dtor", | 628 "-Wno-non-virtual-dtor", |
| 618 "-Wno-sign-promo", | 629 "-Wno-sign-promo", |
| 619 ] | 630 ] |
| 620 } | 631 } |
| 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 } |
| 621 } | 641 } |
| 622 } | 642 } |
| 623 | 643 |
| 624 # This will generate warnings when using Clang if code generates exit-time | 644 # This will generate warnings when using Clang if code generates exit-time |
| 625 # destructors, which will slow down closing the program. | 645 # destructors, which will slow down closing the program. |
| 626 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600 | 646 # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600 |
| 627 config("wexit_time_destructors") { | 647 config("wexit_time_destructors") { |
| 628 if (is_clang) { | 648 if (is_clang) { |
| 629 cflags = [ "-Wexit-time-destructors" ] | 649 cflags = [ "-Wexit-time-destructors" ] |
| 630 } | 650 } |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 } else { | 789 } else { |
| 770 cflags = [ "-g1" ] | 790 cflags = [ "-g1" ] |
| 771 } | 791 } |
| 772 } | 792 } |
| 773 | 793 |
| 774 config("no_symbols") { | 794 config("no_symbols") { |
| 775 if (!is_win) { | 795 if (!is_win) { |
| 776 cflags = [ "-g0" ] | 796 cflags = [ "-g0" ] |
| 777 } | 797 } |
| 778 } | 798 } |
| 779 | |
| OLD | NEW |