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/config/sanitizers/sanitizers.gni") | 9 import("//build/config/sanitizers/sanitizers.gni") |
| 10 import("//build/toolchain/cc_wrapper.gni") | 10 import("//build/toolchain/cc_wrapper.gni") |
| 11 import("//build/toolchain/toolchain.gni") | 11 import("//build/toolchain/toolchain.gni") |
| 12 import("//build_overrides/build.gni") | 12 import("//build_overrides/build.gni") |
| 13 | 13 |
| 14 if (current_cpu == "arm" || current_cpu == "arm64") { | 14 if (current_cpu == "arm" || current_cpu == "arm64") { |
| 15 import("//build/config/arm.gni") | 15 import("//build/config/arm.gni") |
| 16 } | 16 } |
| 17 if (current_cpu == "mipsel" || current_cpu == "mips64el") { | 17 if (current_cpu == "mipsel" || current_cpu == "mips64el") { |
| 18 import("//build/config/mips.gni") | 18 import("//build/config/mips.gni") |
| 19 } | 19 } |
| 20 if (is_win) { | |
| 21 import("//build/config/win/visual_studio_version.gni") | |
| 22 } | |
| 20 if (is_mac) { | 23 if (is_mac) { |
| 21 import("//build/config/mac/symbols.gni") | 24 import("//build/config/mac/symbols.gni") |
| 22 } | 25 } |
| 23 | 26 |
| 24 declare_args() { | 27 declare_args() { |
| 25 # Default to warnings as errors for default workflow, where we catch | 28 # Default to warnings as errors for default workflow, where we catch |
| 26 # warnings with known toolchains. Allow overriding this e.g. for Chromium | 29 # warnings with known toolchains. Allow overriding this e.g. for Chromium |
| 27 # builds on Linux that could use a different version of the compiler. | 30 # builds on Linux that could use a different version of the compiler. |
| 28 # With GCC, warnings in no-Chromium code are always not treated as errors. | 31 # With GCC, warnings in no-Chromium code are always not treated as errors. |
| 29 treat_warnings_as_errors = true | 32 treat_warnings_as_errors = true |
| (...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 902 | 905 |
| 903 # These are variable shadowing warnings that are new in VS2015. We | 906 # These are variable shadowing warnings that are new in VS2015. We |
| 904 # should work through these at some point -- they may be removed from | 907 # should work through these at some point -- they may be removed from |
| 905 # the RTM release in the /W4 set. | 908 # the RTM release in the /W4 set. |
| 906 "/wd4456", | 909 "/wd4456", |
| 907 "/wd4457", | 910 "/wd4457", |
| 908 "/wd4458", | 911 "/wd4458", |
| 909 "/wd4459", | 912 "/wd4459", |
| 910 ] | 913 ] |
| 911 | 914 |
| 912 cflags += [ | 915 if (visual_studio_version == "2015") { |
| 913 # C4312 is a VS 2015 64-bit warning for integer to larger pointer. | 916 cflags += [ |
| 914 # TODO(brucedawson): fix warnings, crbug.com/554200 | 917 # C4312 is a VS 2015 64-bit warning for integer to larger pointer. |
| 915 "/wd4312", | 918 # TODO(brucedawson): fix warnings, crbug.com/554200 |
| 916 ] | 919 "/wd4312", |
| 920 ] | |
|
Michael Achenbach
2016/11/29 09:21:10
Needed to merge non-trivially here...
| |
| 917 | 921 |
| 918 if (current_cpu == "x86") { | 922 if (current_cpu == "x86") { |
| 919 cflags += [ | 923 cflags += [ |
| 920 # VC++ 2015 changes 32-bit size_t truncation warnings from 4244 to | 924 # VC++ 2015 changes 32-bit size_t truncation warnings from 4244 to |
| 921 # 4267. Example: short TruncTest(size_t x) { return x; } | 925 # 4267. Example: short TruncTest(size_t x) { return x; } |
| 922 # Since we disable 4244 we need to disable 4267 during migration. | 926 # Since we disable 4244 we need to disable 4267 during migration. |
| 923 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. | 927 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 924 "/wd4267", | 928 "/wd4267", |
| 925 ] | 929 ] |
| 930 } | |
| 926 } | 931 } |
| 927 | 932 |
| 928 # VS xtree header file needs to be patched or 4702 (unreachable code | 933 # VS xtree header file needs to be patched or 4702 (unreachable code |
| 929 # warning) is reported if _HAS_EXCEPTIONS=0. Disable the warning if xtree is | 934 # warning) is reported if _HAS_EXCEPTIONS=0. Disable the warning if xtree is |
| 930 # not patched. | 935 # not patched. |
| 931 if (!msvs_xtree_patched && | 936 if (!msvs_xtree_patched && |
| 932 exec_script("../../win_is_xtree_patched.py", [], "value") == 0) { | 937 exec_script("../../win_is_xtree_patched.py", [], "value") == 0) { |
| 933 cflags += [ "/wd4702" ] # Unreachable code. | 938 cflags += [ "/wd4702" ] # Unreachable code. |
| 934 } | 939 } |
| 935 | 940 |
| 936 # Building with Clang on Windows is a work in progress and very | 941 # Building with Clang on Windows is a work in progress and very |
| 937 # experimental. See crbug.com/82385. | 942 # experimental. See crbug.com/82385. |
| 943 # Keep this in sync with the similar block in build/common.gypi | |
| 938 if (is_clang) { | 944 if (is_clang) { |
| 939 cflags += [ | 945 cflags += [ |
| 940 # TODO(hans): Make this list shorter eventually, http://crbug.com/504657 | 946 # TODO(hans): Make this list shorter eventually, http://crbug.com/504657 |
| 941 "-Wno-microsoft-enum-value", # http://crbug.com/505296 | 947 "-Wno-microsoft-enum-value", # http://crbug.com/505296 |
| 942 "-Wno-unknown-pragmas", # http://crbug.com/505314 | 948 "-Wno-unknown-pragmas", # http://crbug.com/505314 |
| 943 "-Wno-microsoft-cast", # http://crbug.com/550065 | 949 "-Wno-microsoft-cast", # http://crbug.com/550065 |
| 944 ] | 950 ] |
| 945 } | 951 } |
| 946 } else { | 952 } else { |
| 947 if (is_mac && !is_nacl) { | 953 if (is_mac && !is_nacl) { |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1537 # | 1543 # |
| 1538 # configs -= [ "//build/config/compiler:default_symbols" ] | 1544 # configs -= [ "//build/config/compiler:default_symbols" ] |
| 1539 # configs += [ "//build/config/compiler:symbols" ] | 1545 # configs += [ "//build/config/compiler:symbols" ] |
| 1540 | 1546 |
| 1541 # Full symbols. | 1547 # Full symbols. |
| 1542 config("symbols") { | 1548 config("symbols") { |
| 1543 if (is_win) { | 1549 if (is_win) { |
| 1544 import("//build/toolchain/goma.gni") | 1550 import("//build/toolchain/goma.gni") |
| 1545 cflags = [ "/Zi" ] # Produce PDB file, no edit and continue. | 1551 cflags = [ "/Zi" ] # Produce PDB file, no edit and continue. |
| 1546 | 1552 |
| 1547 if (is_win_fastlink) { | 1553 if (is_win_fastlink && visual_studio_version != "2013") { |
| 1548 # Tell VS 2015+ to create a PDB that references debug | 1554 # Tell VS 2015+ to create a PDB that references debug |
| 1549 # information in .obj and .lib files instead of copying | 1555 # information in .obj and .lib files instead of copying |
| 1550 # it all. This flag is incompatible with /PROFILE | 1556 # it all. This flag is incompatible with /PROFILE |
| 1551 ldflags = [ "/DEBUG:FASTLINK" ] | 1557 ldflags = [ "/DEBUG:FASTLINK" ] |
| 1552 } else { | 1558 } else { |
| 1553 ldflags = [ "/DEBUG" ] | 1559 ldflags = [ "/DEBUG" ] |
| 1554 } | 1560 } |
| 1555 } else { | 1561 } else { |
| 1556 if (is_mac || is_ios) { | 1562 if (is_mac || is_ios) { |
| 1557 cflags = [ "-gdwarf-2" ] | 1563 cflags = [ "-gdwarf-2" ] |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 1579 } | 1585 } |
| 1580 asmflags = cflags | 1586 asmflags = cflags |
| 1581 ldflags = [] | 1587 ldflags = [] |
| 1582 } | 1588 } |
| 1583 } | 1589 } |
| 1584 | 1590 |
| 1585 # Minimal symbols. | 1591 # Minimal symbols. |
| 1586 config("minimal_symbols") { | 1592 config("minimal_symbols") { |
| 1587 if (is_win) { | 1593 if (is_win) { |
| 1588 # Linker symbols for backtraces only. | 1594 # Linker symbols for backtraces only. |
| 1589 cflags = [] | 1595 cflags = [] |
|
Michael Achenbach
2016/11/29 09:21:10
... and here.
| |
| 1590 ldflags = [ "/DEBUG" ] | 1596 ldflags = [ "/DEBUG" ] |
| 1591 } else { | 1597 } else { |
| 1592 if (is_android) { | 1598 if (is_android) { |
| 1593 # Breakpad can't handle DWARF 4 symbols properly yet, so use DWARF 3 | 1599 # Breakpad can't handle DWARF 4 symbols properly yet, so use DWARF 3 |
| 1594 # explicitly on android where we are hitting https://crbug.com/638485. | 1600 # explicitly on android where we are hitting https://crbug.com/638485. |
| 1595 # The arguments MUST be in this order because of a gcc arg parsing bug. | 1601 # The arguments MUST be in this order because of a gcc arg parsing bug. |
| 1596 cflags = [ | 1602 cflags = [ |
| 1597 "-gdwarf-3", | 1603 "-gdwarf-3", |
| 1598 "-g1", | 1604 "-g1", |
| 1599 ] | 1605 ] |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1631 | 1637 |
| 1632 if (is_ios || is_mac) { | 1638 if (is_ios || is_mac) { |
| 1633 # On Mac and iOS, this enables support for ARC (automatic ref-counting). | 1639 # On Mac and iOS, this enables support for ARC (automatic ref-counting). |
| 1634 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. | 1640 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. |
| 1635 config("enable_arc") { | 1641 config("enable_arc") { |
| 1636 common_flags = [ "-fobjc-arc" ] | 1642 common_flags = [ "-fobjc-arc" ] |
| 1637 cflags_objc = common_flags | 1643 cflags_objc = common_flags |
| 1638 cflags_objcc = common_flags | 1644 cflags_objcc = common_flags |
| 1639 } | 1645 } |
| 1640 } | 1646 } |
| OLD | NEW |