Chromium Code Reviews| 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 | 10 |
| 11 if (current_cpu == "arm") { | 11 if (current_cpu == "arm" || current_cpu == "arm64") { |
| 12 import("//build/config/arm.gni") | 12 import("//build/config/arm.gni") |
| 13 } | 13 } |
| 14 if (current_cpu == "mipsel" || current_cpu == "mips64el") { | 14 if (current_cpu == "mipsel" || current_cpu == "mips64el") { |
| 15 import("//build/config/mips.gni") | 15 import("//build/config/mips.gni") |
| 16 } | 16 } |
| 17 if (is_win) { | 17 if (is_win) { |
| 18 import("//build/config/win/visual_studio_version.gni") | 18 import("//build/config/win/visual_studio_version.gni") |
| 19 } | 19 } |
| 20 | 20 |
| 21 declare_args() { | 21 declare_args() { |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 626 "-mstack-alignment=16", | 626 "-mstack-alignment=16", |
| 627 "-mstackrealign", | 627 "-mstackrealign", |
| 628 ] | 628 ] |
| 629 } | 629 } |
| 630 } | 630 } |
| 631 | 631 |
| 632 config("compiler_arm_fpu") { | 632 config("compiler_arm_fpu") { |
| 633 if (current_cpu == "arm" && !is_ios && !is_nacl) { | 633 if (current_cpu == "arm" && !is_ios && !is_nacl) { |
| 634 cflags = [ "-mfpu=$arm_fpu" ] | 634 cflags = [ "-mfpu=$arm_fpu" ] |
| 635 asmflags = cflags | 635 asmflags = cflags |
| 636 } else if (current_cpu == "arm64" && !is_ios && !is_nacl) { | |
| 637 cflags = [ "-mcpu=$arm_fpu" ] | |
|
Nico
2016/04/14 15:43:55
the 32-bit arm branch sets -mfpu, this sets -mcpu.
khasim.mohammed
2016/04/14 16:38:46
-mpu is a 32bit only option, for 64bit mpu is not
| |
| 638 asmflags = cflags | |
| 636 } | 639 } |
| 637 } | 640 } |
| 638 | 641 |
| 639 # runtime_library ------------------------------------------------------------- | 642 # runtime_library ------------------------------------------------------------- |
| 640 # | 643 # |
| 641 # Sets the runtime library and associated options. | 644 # Sets the runtime library and associated options. |
| 642 # | 645 # |
| 643 # How do you determine what should go in here vs. "compiler" above? Consider if | 646 # How do you determine what should go in here vs. "compiler" above? Consider if |
| 644 # a target might choose to use a different runtime library (ignore for a moment | 647 # a target might choose to use a different runtime library (ignore for a moment |
| 645 # if this is possible or reasonable on your system). If such a target would want | 648 # if this is possible or reasonable on your system). If such a target would want |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 877 # http://crbug.com/255186 | 880 # http://crbug.com/255186 |
| 878 "-Wno-deprecated-register", | 881 "-Wno-deprecated-register", |
| 879 | 882 |
| 880 # TODO(thakis): This used to be implied by -Wno-unused-function, | 883 # TODO(thakis): This used to be implied by -Wno-unused-function, |
| 881 # which we no longer use. Check if it makes sense to remove | 884 # which we no longer use. Check if it makes sense to remove |
| 882 # this as well. http://crbug.com/316352 | 885 # this as well. http://crbug.com/316352 |
| 883 "-Wno-unneeded-internal-declaration", | 886 "-Wno-unneeded-internal-declaration", |
| 884 | 887 |
| 885 # TODO(hans): Get this cleaned up, http://crbug.com/428099 | 888 # TODO(hans): Get this cleaned up, http://crbug.com/428099 |
| 886 "-Wno-inconsistent-missing-override", | 889 "-Wno-inconsistent-missing-override", |
| 890 "-Wno-error=unused-command-line-argument", | |
|
Nico
2016/04/14 15:43:55
why is this needed?
we want a warning-free build,
khasim.mohammed
2016/04/14 16:38:46
I will remove this. It is not needed.
| |
| 887 ] | 891 ] |
| 888 | 892 |
| 889 # NaCl's Clang compiler and Chrome's hermetic Clang compiler will almost | 893 # NaCl's Clang compiler and Chrome's hermetic Clang compiler will almost |
| 890 # always have different versions. Certain flags may not be recognized by | 894 # always have different versions. Certain flags may not be recognized by |
| 891 # one version or the other. | 895 # one version or the other. |
| 892 if (!is_nacl) { | 896 if (!is_nacl) { |
| 893 # Flags NaCl (Clang 3.7) does not recognize. | 897 # Flags NaCl (Clang 3.7) does not recognize. |
| 894 cflags += [ | 898 cflags += [ |
| 895 # TODO(thakis): Enable this, crbug.com/507717 | 899 # TODO(thakis): Enable this, crbug.com/507717 |
| 896 "-Wno-shift-negative-value", | 900 "-Wno-shift-negative-value", |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 908 if (is_win) { | 912 if (is_win) { |
| 909 cflags = [ "/W4" ] # Warning level 4. | 913 cflags = [ "/W4" ] # Warning level 4. |
| 910 } else { | 914 } else { |
| 911 cflags = [ "-Wall" ] | 915 cflags = [ "-Wall" ] |
| 912 if (treat_warnings_as_errors) { | 916 if (treat_warnings_as_errors) { |
| 913 cflags += [ "-Werror" ] | 917 cflags += [ "-Werror" ] |
| 914 } | 918 } |
| 915 if (is_clang) { | 919 if (is_clang) { |
| 916 # Enable -Wextra for chromium_code when we control the compiler. | 920 # Enable -Wextra for chromium_code when we control the compiler. |
| 917 cflags += [ "-Wextra" ] | 921 cflags += [ "-Wextra" ] |
| 922 cflags += [ "-Wno-error=implicit-exception-spec-mismatch" ] | |
| 918 } | 923 } |
| 919 | 924 |
| 920 # In Chromium code, we define __STDC_foo_MACROS in order to get the | 925 # In Chromium code, we define __STDC_foo_MACROS in order to get the |
| 921 # C99 macros on Mac and Linux. | 926 # C99 macros on Mac and Linux. |
| 922 defines = [ | 927 defines = [ |
| 923 "__STDC_CONSTANT_MACROS", | 928 "__STDC_CONSTANT_MACROS", |
| 924 "__STDC_FORMAT_MACROS", | 929 "__STDC_FORMAT_MACROS", |
| 925 ] | 930 ] |
| 926 | 931 |
| 927 if (!is_debug && !using_sanitizer && | 932 if (!is_debug && !using_sanitizer && |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 968 # https://codereview.webrtc.org/1552863002/ made its way into chromium. | 973 # https://codereview.webrtc.org/1552863002/ made its way into chromium. |
| 969 cflags += [ "-Wall" ] | 974 cflags += [ "-Wall" ] |
| 970 } | 975 } |
| 971 } | 976 } |
| 972 | 977 |
| 973 if (is_clang) { | 978 if (is_clang) { |
| 974 cflags += [ | 979 cflags += [ |
| 975 # Lots of third-party libraries have unused variables. Instead of | 980 # Lots of third-party libraries have unused variables. Instead of |
| 976 # suppressing them individually, we just blanket suppress them here. | 981 # suppressing them individually, we just blanket suppress them here. |
| 977 "-Wno-unused-variable", | 982 "-Wno-unused-variable", |
| 983 "-Wno-asm-operand-widths", | |
| 978 ] | 984 ] |
| 979 } | 985 } |
| 980 | 986 |
| 981 if (is_linux || is_android) { | 987 if (is_linux || is_android) { |
| 982 cflags_cc += [ | 988 cflags_cc += [ |
| 983 # Don't warn about hash_map in third-party code. | 989 # Don't warn about hash_map in third-party code. |
| 984 "-Wno-deprecated", | 990 "-Wno-deprecated", |
| 985 ] | 991 ] |
| 986 } | 992 } |
| 987 | 993 |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1338 | 1344 |
| 1339 if (is_ios || is_mac) { | 1345 if (is_ios || is_mac) { |
| 1340 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1346 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
| 1341 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1347 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
| 1342 config("enable_arc") { | 1348 config("enable_arc") { |
| 1343 common_flags = [ "-fobjc-arc" ] | 1349 common_flags = [ "-fobjc-arc" ] |
| 1344 cflags_objc = common_flags | 1350 cflags_objc = common_flags |
| 1345 cflags_objcc = common_flags | 1351 cflags_objcc = common_flags |
| 1346 } | 1352 } |
| 1347 } | 1353 } |
| OLD | NEW |