File: clang.gni

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (70 lines) | stat: -rw-r--r-- 2,882 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/c++/c++.gni")
import("//build/toolchain/rbe.gni")
import("//build/toolchain/siso.gni")
import("//build/toolchain/toolchain.gni")

default_clang_base_path = "//third_party/llvm-build/Release+Asserts"

declare_args() {
  # Indicates if the build should use the Chrome-specific plugins for enforcing
  # coding guidelines, etc. Only used when compiling with Chrome's Clang, not
  # Chrome OS's.
  clang_use_chrome_plugins =
      is_clang && !is_nacl && current_os != "zos" &&
      default_toolchain != "//build/toolchain/cros:target" &&
      # TODO(https://crbug.com/351909443): Remove this after fixing performance
      # of Clang modules build.
      !use_libcxx_modules

  # Use this instead of clang_use_chrome_plugins to enable just the raw-ptr-plugin.
  clang_use_raw_ptr_plugin = false

  enable_check_raw_ptr_fields =
      build_with_chromium && !is_official_build &&
      ((is_linux && !is_castos) || (is_android && !is_cast_android) || is_mac ||
       is_ios || is_win || is_chromeos)

  # TODO(crbug.com/40268473): Merge with enable_check_raw_ptr_fields once both
  # checks are activated on the same set of platforms.
  enable_check_raw_ref_fields =
      build_with_chromium && !is_official_build &&
      ((is_linux && !is_castos) || (is_android && !is_cast_android) || is_win ||
       is_mac || is_ios || is_chromeos)

  clang_base_path = default_clang_base_path

  # Specifies whether or not bitcode should be embedded during compilation.
  # This is used for creating a MLGO corpus from Chromium in the non-ThinLTO case.
  clang_embed_bitcode = false

  # Set to true to enable output of ThinLTO index and import files used for
  # creating a Chromium MLGO corpus in the ThinLTO case.
  lld_emit_indexes_and_imports = false
}

# We don't really need to collect a corpus for the host tools, just for the target.
lld_emit_indexes_and_imports =
    lld_emit_indexes_and_imports && is_a_target_toolchain

# TODO(crbug.com/326584510): Reclient does not upload `inputs` from C/C++
# targets. We work around the bug in Reclient by
# specifying the files here.
rbe_bug_326584510_missing_input_list = []
if (clang_use_chrome_plugins && defined(clang_unsafe_buffers_paths) &&
    "$clang_unsafe_buffers_paths" != "") {
  rbe_bug_326584510_missing_input_list +=
      [ rebase_path(clang_unsafe_buffers_paths, rbe_exec_root) ]
}
if (defined(clang_warning_suppression_file) &&
    "$clang_warning_suppression_file" != "") {
  rbe_bug_326584510_missing_input_list +=
      [ rebase_path(clang_warning_suppression_file, rbe_exec_root) ]
}

# The leading space is important, if the string is non-empty.
rbe_bug_326584510_missing_inputs =
    " -inputs=" + string_join(",", rbe_bug_326584510_missing_input_list)