Source code

Revision control

Copy as Markdown

Other Tools

# 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("//chromium/build/config/c++/c++.gni")
import("//chromium/build/toolchain/rbe.gni")
import("//chromium/build/toolchain/siso.gni")
import("//chromium/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 != "//chromium/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" != "") {
if (rbe_exec_root != rebase_path("//")) {
assert(!use_siso, "Can't use non-default rbe_exec_root with siso.")
}
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" != "") {
if (rbe_exec_root != rebase_path("//")) {
assert(!use_siso, "Can't use non-default rbe_exec_root with siso.")
}
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)