| 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 import("//build/toolchain/toolchain.gni") | 10 import("//build/toolchain/toolchain.gni") |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 } else { | 296 } else { |
| 297 cflags += [ "-funwind-tables" ] | 297 cflags += [ "-funwind-tables" ] |
| 298 } | 298 } |
| 299 } | 299 } |
| 300 } | 300 } |
| 301 | 301 |
| 302 # Linux/Android common flags setup. | 302 # Linux/Android common flags setup. |
| 303 # --------------------------------- | 303 # --------------------------------- |
| 304 if (is_linux || is_android) { | 304 if (is_linux || is_android) { |
| 305 if (use_pic) { | 305 if (use_pic) { |
| 306 cflags += [ "-fPIC" ] | 306 cflags += [ |
| 307 ldflags += [ "-fPIC" ] | 307 "-fPIC", |
| 308 ] |
| 309 ldflags += [ |
| 310 "-fPIC", |
| 311 ] |
| 308 } | 312 } |
| 309 | 313 |
| 310 cflags += [ "-pipe" ] # Use pipes for communicating between sub-processes.
Faster. | 314 cflags += [ |
| 315 "-pipe", # Use pipes for communicating between sub-processes. Faster. |
| 316 ] |
| 311 | 317 |
| 312 ldflags += [ | 318 ldflags += [ |
| 313 "-Wl,-z,noexecstack", | 319 "-Wl,-z,noexecstack", |
| 314 "-Wl,-z,now", | 320 "-Wl,-z,now", |
| 315 "-Wl,-z,relro", | 321 "-Wl,-z,relro", |
| 316 ] | 322 ] |
| 317 if (!using_sanitizer) { | 323 if (!using_sanitizer) { |
| 318 if (!use_cfi_diag) { | 324 if (!use_cfi_diag) { |
| 319 ldflags += [ "-Wl,-z,defs" ] | 325 ldflags += [ "-Wl,-z,defs" ] |
| 320 } | 326 } |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 # compile-time constant expression (due to constant template args, | 898 # compile-time constant expression (due to constant template args, |
| 893 # conditionals comparing the sizes of different types, etc.). Some of | 899 # conditionals comparing the sizes of different types, etc.). Some of |
| 894 # these can be worked around, but it's not worth it. | 900 # these can be worked around, but it's not worth it. |
| 895 "/wd4127", | 901 "/wd4127", |
| 896 | 902 |
| 897 # C4251: 'identifier' : class 'type' needs to have dll-interface to be | 903 # C4251: 'identifier' : class 'type' needs to have dll-interface to be |
| 898 # used by clients of class 'type2' | 904 # used by clients of class 'type2' |
| 899 # This is necessary for the shared library build. | 905 # This is necessary for the shared library build. |
| 900 "/wd4251", | 906 "/wd4251", |
| 901 | 907 |
| 902 # C4312 is a VS 2015 64-bit warning for integer to larger pointer. | |
| 903 # TODO(brucedawson): fix warnings, crbug.com/554200 | |
| 904 "/wd4312", | |
| 905 | |
| 906 # C4351: new behavior: elements of array 'array' will be default | 908 # C4351: new behavior: elements of array 'array' will be default |
| 907 # initialized | 909 # initialized |
| 908 # This is a silly "warning" that basically just alerts you that the | 910 # This is a silly "warning" that basically just alerts you that the |
| 909 # compiler is going to actually follow the language spec like it's | 911 # compiler is going to actually follow the language spec like it's |
| 910 # supposed to, instead of not following it like old buggy versions did. | 912 # supposed to, instead of not following it like old buggy versions did. |
| 911 # There's absolutely no reason to turn this on. | 913 # There's absolutely no reason to turn this on. |
| 912 "/wd4351", | 914 "/wd4351", |
| 913 | 915 |
| 914 # C4355: 'this': used in base member initializer list | 916 # C4355: 'this': used in base member initializer list |
| 915 # It's commonly useful to pass |this| to objects in a class' initializer | 917 # It's commonly useful to pass |this| to objects in a class' initializer |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 | 960 |
| 959 # These are variable shadowing warnings that are new in VS2015. We | 961 # These are variable shadowing warnings that are new in VS2015. We |
| 960 # should work through these at some point -- they may be removed from | 962 # should work through these at some point -- they may be removed from |
| 961 # the RTM release in the /W4 set. | 963 # the RTM release in the /W4 set. |
| 962 "/wd4456", | 964 "/wd4456", |
| 963 "/wd4457", | 965 "/wd4457", |
| 964 "/wd4458", | 966 "/wd4458", |
| 965 "/wd4459", | 967 "/wd4459", |
| 966 ] | 968 ] |
| 967 | 969 |
| 968 cflags_cc += [ | 970 cflags += [ |
| 969 # Allow "noexcept" annotations even though we compile with exceptions | 971 # C4312 is a VS 2015 64-bit warning for integer to larger pointer. |
| 970 # disabled. | 972 # TODO(brucedawson): fix warnings, crbug.com/554200 |
| 971 "/wd4577", | 973 "/wd4312", |
| 972 ] | 974 ] |
| 973 | 975 |
| 974 if (current_cpu == "x86") { | 976 if (current_cpu == "x86") { |
| 975 cflags += [ | 977 cflags += [ |
| 976 # VC++ 2015 changes 32-bit size_t truncation warnings from 4244 to | 978 # VC++ 2015 changes 32-bit size_t truncation warnings from 4244 to |
| 977 # 4267. Example: short TruncTest(size_t x) { return x; } | 979 # 4267. Example: short TruncTest(size_t x) { return x; } |
| 978 # Since we disable 4244 we need to disable 4267 during migration. | 980 # Since we disable 4244 we need to disable 4267 during migration. |
| 979 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 981 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 980 "/wd4267", | 982 "/wd4267", |
| 981 ] | 983 ] |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1712 | 1714 |
| 1713 if (is_ios || is_mac) { | 1715 if (is_ios || is_mac) { |
| 1714 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1716 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
| 1715 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1717 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
| 1716 config("enable_arc") { | 1718 config("enable_arc") { |
| 1717 common_flags = [ "-fobjc-arc" ] | 1719 common_flags = [ "-fobjc-arc" ] |
| 1718 cflags_objc = common_flags | 1720 cflags_objc = common_flags |
| 1719 cflags_objcc = common_flags | 1721 cflags_objcc = common_flags |
| 1720 } | 1722 } |
| 1721 } | 1723 } |
| OLD | NEW |