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