Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(436)

Side by Side Diff: gn/BUILD.gn

Issue 2369033002: GN: detect is_clang, use it to switch Clang to warning blacklist. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | gn/is_clang.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 Google Inc. 1 # Copyright 2016 Google Inc.
2 # 2 #
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 declare_args() { 6 declare_args() {
7 ar = "ar" 7 ar = "ar"
8 cc = "cc" 8 cc = "cc"
9 cxx = "c++" 9 cxx = "c++"
10 10
11 if (is_android) { 11 if (is_android) {
12 ar = "$ndk/toolchains/$ndk_gccdir-4.9/prebuilt/$ndk_host/$ndk_target/bin/ar" 12 ar = "$ndk/toolchains/$ndk_gccdir-4.9/prebuilt/$ndk_host/$ndk_target/bin/ar"
13 cc = "$ndk/toolchains/llvm/prebuilt/$ndk_host/bin/clang" 13 cc = "$ndk/toolchains/llvm/prebuilt/$ndk_host/bin/clang"
14 cxx = "$ndk/toolchains/llvm/prebuilt/$ndk_host/bin/clang++" 14 cxx = "$ndk/toolchains/llvm/prebuilt/$ndk_host/bin/clang++"
15 } 15 }
16 16
17 windk = "" 17 windk = ""
18 18
19 extra_cflags = "" 19 extra_cflags = ""
20 extra_cflags_c = "" 20 extra_cflags_c = ""
21 extra_cflags_cc = "" 21 extra_cflags_cc = ""
22 extra_ldflags = "" 22 extra_ldflags = ""
23 23
24 cc_wrapper = "" 24 cc_wrapper = ""
25 } 25 }
26 26
27 is_clang = exec_script("is_clang.py",
28 [
29 cc,
30 cxx,
31 ],
32 "value")
33
27 config("default") { 34 config("default") {
28 asmflags = [] 35 asmflags = []
29 cflags = [] 36 cflags = []
30 cflags_c = [] 37 cflags_c = []
31 cflags_cc = [] 38 cflags_cc = []
32 defines = [] 39 defines = []
33 ldflags = [] 40 ldflags = []
34 41
35 if (is_win) { 42 if (is_win) {
36 cflags += [ 43 cflags += [
(...skipping 26 matching lines...) Expand all
63 "-Wno-unused-parameter", 70 "-Wno-unused-parameter",
64 ] 71 ]
65 cflags_cc += [ 72 cflags_cc += [
66 "-std=c++11", 73 "-std=c++11",
67 "-fno-exceptions", 74 "-fno-exceptions",
68 "-fno-threadsafe-statics", 75 "-fno-threadsafe-statics",
69 "-fvisibility-inlines-hidden", 76 "-fvisibility-inlines-hidden",
70 77
71 "-Wnon-virtual-dtor", 78 "-Wnon-virtual-dtor",
72 ] 79 ]
80 if (is_clang) {
81 cflags += [
82 "-Weverything",
83 "-Wno-unknown-warning-option", # Let older Clangs ignore newer Clangs' warnings.
84 ]
85
86 # High priority to fix!
87 cflags += [
88 "-Wno-comma",
89 "-Wno-conditional-uninitialized",
90 "-Wno-covered-switch-default",
91 "-Wno-deprecated",
92 "-Wno-format-nonliteral",
93 "-Wno-over-aligned",
94 "-Wno-shadow",
95 "-Wno-shift-sign-overflow",
96 "-Wno-undefined-func-template",
97 "-Wno-undefined-reinterpret-cast",
98 ]
99
100 cflags += [
101 "-Wno-cast-align",
102 "-Wno-class-varargs",
103 "-Wno-conversion",
104 "-Wno-disabled-macro-expansion",
105 "-Wno-documentation",
106 "-Wno-documentation-unknown-command",
107 "-Wno-double-promotion",
108 "-Wno-exit-time-destructors", # TODO: OK outside libskia
109 "-Wno-extra-semi",
110 "-Wno-float-conversion",
111 "-Wno-float-equal",
112 "-Wno-global-constructors", # TODO: OK outside libskia
113 "-Wno-gnu-anonymous-struct",
114 "-Wno-gnu-zero-variadic-macro-arguments",
115 "-Wno-missing-prototypes",
116 "-Wno-missing-variable-declarations",
117 "-Wno-nested-anon-types",
118 "-Wno-newline-eof",
119 "-Wno-pedantic",
120 "-Wno-reserved-id-macro",
121 "-Wno-sign-conversion",
122 "-Wno-switch-enum",
123 "-Wno-undef",
124 "-Wno-unreachable-code",
125 "-Wno-unreachable-code-break",
126 "-Wno-unreachable-code-return",
127 "-Wno-unused-macros",
128 "-Wno-unused-member-function",
129 ]
130 cflags_cc += [
131 "-Wno-abstract-vbase-init",
132 "-Wno-range-loop-analysis",
133 "-Wno-weak-vtables",
134 ]
135
136 # We are unlikely to want to fix these.
137 cflags += [
138 "-Wno-implicit-fallthrough",
139 "-Wno-missing-noreturn",
140 "-Wno-old-style-cast",
141 "-Wno-padded",
142 ]
143 cflags_cc += [
144 "-Wno-c++98-compat",
145 "-Wno-c++98-compat-pedantic",
146 ]
147 }
73 } 148 }
74 149
75 if (current_cpu == "arm") { 150 if (current_cpu == "arm") {
76 cflags += [ 151 cflags += [
77 "-march=armv7-a", 152 "-march=armv7-a",
78 "-mfpu=neon", 153 "-mfpu=neon",
79 "-mthumb", 154 "-mthumb",
80 ] 155 ]
81 } else if (current_cpu == "mipsel") { 156 } else if (current_cpu == "mipsel") {
82 cflags += [ 157 cflags += [
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 } 437 }
363 438
364 tool("stamp") { 439 tool("stamp") {
365 command = "touch {{output}}" 440 command = "touch {{output}}"
366 } 441 }
367 442
368 tool("copy") { 443 tool("copy") {
369 command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})" 444 command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})"
370 } 445 }
371 } 446 }
OLDNEW
« no previous file with comments | « no previous file | gn/is_clang.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698