xref: /aosp_15_r20/external/cronet/build/config/clang/clang.gni (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1# Copyright 2014 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/chromeos/ui_mode.gni")
6import("//build/toolchain/toolchain.gni")
7
8default_clang_base_path = "//third_party/llvm-build/Release+Asserts"
9
10declare_args() {
11  # Indicates if the build should use the Chrome-specific plugins for enforcing
12  # coding guidelines, etc. Only used when compiling with Chrome's Clang, not
13  # Chrome OS's.
14  clang_use_chrome_plugins =
15      is_clang && !is_nacl && current_os != "zos" &&
16      default_toolchain != "//build/toolchain/cros:target"
17
18  enable_check_raw_ptr_fields =
19      build_with_chromium && !is_official_build &&
20      ((is_linux && !is_castos) || (is_android && !is_cast_android) || is_mac ||
21       is_win || is_chromeos_lacros || is_chromeos_ash)
22
23  # TODO(crbug.com/1446146): Merge with enable_check_raw_ptr_fields once both
24  # checks are activated on the same set of platforms.
25  enable_check_raw_ref_fields =
26      build_with_chromium && !is_official_build &&
27      ((is_linux && !is_castos) || (is_android && !is_cast_android) || is_win ||
28       is_mac || is_chromeos_lacros || is_chromeos_ash)
29
30  clang_base_path = default_clang_base_path
31
32  # Specifies whether or not bitcode should be embedded during compilation.
33  # This is used for creating a MLGO corpus from Chromium in the non-ThinLTO case.
34  clang_embed_bitcode = false
35
36  # Set to true to enable output of ThinLTO index and import files used for
37  # creating a Chromium MLGO corpus in the ThinLTO case.
38  lld_emit_indexes_and_imports = false
39}
40
41# We don't really need to collect a corpus for the host tools, just for the target.
42lld_emit_indexes_and_imports =
43    lld_emit_indexes_and_imports && is_a_target_toolchain
44