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("clang.gni") | 5 import("clang.gni") |
6 | 6 |
7 config("find_bad_constructs") { | 7 config("find_bad_constructs") { |
8 if (clang_use_chrome_plugins) { | 8 if (clang_use_chrome_plugins) { |
9 cflags = [ | 9 cflags = [] |
10 "-Xclang", | 10 |
11 "-load", | 11 # On Windows, the plugin is built directly into clang, so there's |
12 "-Xclang", | 12 # no need to load it dynamically. |
13 ] | |
14 | 13 |
15 if (is_mac || is_ios) { | 14 if (is_mac || is_ios) { |
16 cflags += [ rebase_path( | 15 cflags += [ |
17 "//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs
.dylib", | 16 "-Xclang", |
18 root_build_dir) ] | 17 "-load", |
| 18 "-Xclang", |
| 19 rebase_path( |
| 20 "//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.d
ylib", |
| 21 root_build_dir), |
| 22 ] |
19 } else if (is_linux) { | 23 } else if (is_linux) { |
20 cflags += [ rebase_path( | 24 cflags += [ |
21 "//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs
.so", | 25 "-Xclang", |
22 root_build_dir) ] | 26 "-load", |
| 27 "-Xclang", |
| 28 rebase_path( |
| 29 "//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.s
o", |
| 30 root_build_dir), |
| 31 ] |
23 } | 32 } |
24 | 33 |
25 cflags += [ | 34 cflags += [ |
26 "-Xclang", | 35 "-Xclang", |
27 "-add-plugin", | 36 "-add-plugin", |
28 "-Xclang", | 37 "-Xclang", |
29 "find-bad-constructs", | 38 "find-bad-constructs", |
30 ] | 39 ] |
31 } | 40 } |
32 } | 41 } |
33 | 42 |
34 # Enables some extra Clang-specific warnings. Some third-party code won't | 43 # Enables some extra Clang-specific warnings. Some third-party code won't |
35 # compile with these so may want to remove this config. | 44 # compile with these so may want to remove this config. |
36 config("extra_warnings") { | 45 config("extra_warnings") { |
37 cflags = [ | 46 cflags = [ |
38 "-Wheader-hygiene", | 47 "-Wheader-hygiene", |
39 | 48 |
40 # Warns when a const char[] is converted to bool. | 49 # Warns when a const char[] is converted to bool. |
41 "-Wstring-conversion", | 50 "-Wstring-conversion", |
42 ] | 51 ] |
43 } | 52 } |
OLD | NEW |