| 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 (current_cpu == "arm") { | 6 if (current_cpu == "arm") { |
| 7 import("//build/config/arm.gni") | 7 import("//build/config/arm.gni") |
| 8 } | 8 } |
| 9 if (current_cpu == "mipsel" || current_cpu == "mips64el") { | 9 if (current_cpu == "mipsel" || current_cpu == "mips64el") { |
| 10 import("//build/config/mips.gni") | 10 import("//build/config/mips.gni") |
| 11 } | 11 } |
| 12 if (is_posix) { | 12 if (is_posix) { |
| 13 import("//build/config/gcc/gcc_version.gni") | 13 import("//build/config/gcc/gcc_version.gni") |
| 14 } | 14 } |
| 15 if (is_win) { | 15 if (is_win) { |
| 16 import("//build/config/win/visual_studio_version.gni") | 16 import("//build/config/win/visual_studio_version.gni") |
| 17 } | 17 } |
| 18 | 18 |
| 19 import("//build/toolchain/ccache.gni") | 19 import("//build/toolchain/ccache.gni") |
| 20 import("//build/config/sanitizers/sanitizers.gni") | |
| 21 | 20 |
| 22 # default_include_dirs --------------------------------------------------------- | 21 # default_include_dirs --------------------------------------------------------- |
| 23 # | 22 # |
| 24 # This is a separate config so that third_party code (which would not use the | 23 # This is a separate config so that third_party code (which would not use the |
| 25 # source root and might have conflicting versions of some headers) can remove | 24 # source root and might have conflicting versions of some headers) can remove |
| 26 # this and specify their own include paths. | 25 # this and specify their own include paths. |
| 27 config("default_include_dirs") { | 26 config("default_include_dirs") { |
| 28 include_dirs = [ | 27 include_dirs = [ |
| 29 "//", | 28 "//", |
| 30 root_gen_dir, | 29 root_gen_dir, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 84 } |
| 86 | 85 |
| 87 # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer and | 86 # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer and |
| 88 # MemorySanitizer | 87 # MemorySanitizer |
| 89 if (using_sanitizer) { | 88 if (using_sanitizer) { |
| 90 cflags += [ | 89 cflags += [ |
| 91 "-gline-tables-only", | 90 "-gline-tables-only", |
| 92 ] | 91 ] |
| 93 } | 92 } |
| 94 if (is_asan) { | 93 if (is_asan) { |
| 95 asan_blacklist_path = | 94 cflags += [ "-fsanitize=address" ] |
| 96 rebase_path("//tools/memory/asan/blacklist.txt", root_build_dir) | 95 ldflags += [ "-fsanitize=address" ] |
| 97 cflags += [ | |
| 98 "-fsanitize=address", | |
| 99 "-fsanitize-blacklist=$asan_blacklist_path", | |
| 100 ] | |
| 101 if (is_mac) { | |
| 102 cflags += [ "-mllvm -asan-globals=0" ] # http://crbug.com/352073 | |
| 103 # TODO(GYP): deal with mac_bundles. | |
| 104 } | |
| 105 } | 96 } |
| 106 if (is_lsan) { | 97 if (is_lsan) { |
| 107 cflags += [ "-fsanitize=leak" ] | 98 cflags += [ "-fsanitize=leak" ] |
| 99 ldflags += [ "-fsanitize=leak" ] |
| 108 } | 100 } |
| 109 if (is_tsan) { | 101 if (is_tsan) { |
| 110 tsan_blacklist_path = | 102 cflags += [ "-fsanitize=thread" ] |
| 111 rebase_path("//tools/memory/tsan_v2/ignores.txt", root_build_dir) | 103 ldflags += [ "-fsanitize=thread" ] |
| 112 cflags += [ | |
| 113 "-fsanitize=thread", | |
| 114 "-fsanitize-blacklist=$tsan_blacklist_path", | |
| 115 ] | |
| 116 } | 104 } |
| 117 if (is_msan) { | 105 if (is_msan) { |
| 118 msan_blacklist_path = | 106 cflags += [ "-fsanitize=memory" ] |
| 119 rebase_path("//tools/msan/blacklist.txt", root_build_dir) | 107 ldflags += [ "-fsanitize=memory" ] |
| 120 cflags += [ | |
| 121 "-fsanitize=memory", | |
| 122 "-fsanitize-memory-track-origins=$msan_track_origins", | |
| 123 "-fsanitize-blacklist=$msan_blacklist_path", | |
| 124 ] | |
| 125 } | |
| 126 | |
| 127 if (use_custom_libcxx) { | |
| 128 cflags_cc += [ "-nostdinc++" ] | |
| 129 include_dirs = [ | |
| 130 "//buildtools/third_party/libc++/trunk/include", | |
| 131 "//buildtools/third_party/libc++abi/trunk/include", | |
| 132 ] | |
| 133 } | 108 } |
| 134 } | 109 } |
| 135 | 110 |
| 136 if (is_clang && is_debug) { | 111 if (is_clang && is_debug) { |
| 137 # Allow comparing the address of references and 'this' against 0 | 112 # Allow comparing the address of references and 'this' against 0 |
| 138 # in debug builds. Technically, these can never be null in | 113 # in debug builds. Technically, these can never be null in |
| 139 # well-defined C/C++ and Clang can optimize such checks away in | 114 # well-defined C/C++ and Clang can optimize such checks away in |
| 140 # release builds, but they may be used in asserts in debug builds. | 115 # release builds, but they may be used in asserts in debug builds. |
| 141 extra_flags = [ | 116 extra_flags = [ |
| 142 "-Wno-undefined-bool-conversion", | 117 "-Wno-undefined-bool-conversion", |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 cflags = [ "/Zi" ] # Produce PDB file, no edit and continue. | 766 cflags = [ "/Zi" ] # Produce PDB file, no edit and continue. |
| 792 } | 767 } |
| 793 ldflags = [ "/DEBUG" ] | 768 ldflags = [ "/DEBUG" ] |
| 794 } else { | 769 } else { |
| 795 cflags = [ | 770 cflags = [ |
| 796 "-g3", | 771 "-g3", |
| 797 "-ggdb3", | 772 "-ggdb3", |
| 798 ] | 773 ] |
| 799 } | 774 } |
| 800 } | 775 } |
| OLD | NEW |