• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3# found in the LICENSE file.
4
5import("clang.gni")
6
7config("find_bad_constructs") {
8  if (clang_use_chrome_plugins) {
9    cflags = [
10      "-Xclang", "-load",
11      "-Xclang",
12    ]
13
14    if (is_mac || is_ios) {
15      cflags += [ rebase_path(
16        "//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib",
17        root_build_dir) ]
18    } else if (is_linux) {
19      cflags += [ rebase_path(
20        "//third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so",
21        root_build_dir) ]
22    }
23
24    cflags += [
25      "-Xclang", "-add-plugin",
26      "-Xclang", "find-bad-constructs",
27    ]
28  }
29}
30
31# Enables some extra Clang-specific warnings. Some third-party code won't
32# compile with these so may want to remove this config.
33config("extra_warnings") {
34  cflags = [
35    "-Wheader-hygiene",
36
37    # Warns when a const char[] is converted to bool.
38    "-Wstring-conversion",
39  ]
40}
41