2022-05-09 04:19:04 +00:00
|
|
|
# Copyright (c) 2018 The Chromium Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
# Flags specified here must not impact ABI. Code compiled with and without these
|
|
|
|
# opts will be linked together, and in some cases headers compiled with and
|
|
|
|
# without these options will be part of the same program.
|
|
|
|
|
|
|
|
import("//build/config/c++/c++.gni")
|
2022-08-29 17:59:48 +00:00
|
|
|
import("//build/config/nacl/config.gni")
|
2022-05-09 04:19:04 +00:00
|
|
|
import("//build/config/sanitizers/sanitizers.gni")
|
|
|
|
import("//build/toolchain/toolchain.gni")
|
|
|
|
import("//build_overrides/build.gni")
|
|
|
|
import("//third_party/abseil-cpp/absl.gni")
|
|
|
|
|
|
|
|
config("absl_component_build") {
|
|
|
|
defines = [ "ABSL_CONSUME_DLL" ]
|
|
|
|
}
|
|
|
|
|
2022-08-29 17:59:48 +00:00
|
|
|
assert(!is_nacl || is_nacl_saigo,
|
|
|
|
"base must not be built in most nacl toolchains")
|
|
|
|
|
2022-05-09 04:19:04 +00:00
|
|
|
component("absl") {
|
|
|
|
public_deps = [ ":absl_component_deps" ]
|
|
|
|
if (is_component_build) {
|
|
|
|
public_configs = [ ":absl_component_build" ]
|
|
|
|
|
|
|
|
if (is_win && is_clang) {
|
|
|
|
if (current_cpu == "x64") {
|
|
|
|
if (is_debug) {
|
|
|
|
sources = [ "symbols_x64_dbg.def" ]
|
|
|
|
} else {
|
|
|
|
if (is_asan) {
|
|
|
|
sources = [ "symbols_x64_rel_asan.def" ]
|
|
|
|
} else {
|
|
|
|
sources = [ "symbols_x64_rel.def" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (current_cpu == "x86") {
|
|
|
|
if (is_debug) {
|
|
|
|
sources = [ "symbols_x86_dbg.def" ]
|
|
|
|
} else {
|
|
|
|
sources = [ "symbols_x86_rel.def" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (current_cpu == "arm64") {
|
|
|
|
if (is_debug) {
|
|
|
|
sources = [ "symbols_arm64_dbg.def" ]
|
|
|
|
} else {
|
|
|
|
sources = [ "symbols_arm64_rel.def" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
group("absl_component_deps") {
|
|
|
|
public_deps = [
|
|
|
|
"//third_party/abseil-cpp/absl/algorithm:container",
|
|
|
|
"//third_party/abseil-cpp/absl/base",
|
|
|
|
"//third_party/abseil-cpp/absl/base:config",
|
|
|
|
"//third_party/abseil-cpp/absl/base:core_headers",
|
2022-08-29 17:59:48 +00:00
|
|
|
"//third_party/abseil-cpp/absl/cleanup",
|
2022-05-09 04:19:04 +00:00
|
|
|
"//third_party/abseil-cpp/absl/container:btree",
|
|
|
|
"//third_party/abseil-cpp/absl/container:fixed_array",
|
|
|
|
"//third_party/abseil-cpp/absl/container:flat_hash_map",
|
|
|
|
"//third_party/abseil-cpp/absl/container:flat_hash_set",
|
|
|
|
"//third_party/abseil-cpp/absl/container:inlined_vector",
|
|
|
|
"//third_party/abseil-cpp/absl/container:node_hash_map",
|
|
|
|
"//third_party/abseil-cpp/absl/container:node_hash_set",
|
|
|
|
"//third_party/abseil-cpp/absl/debugging:failure_signal_handler",
|
|
|
|
"//third_party/abseil-cpp/absl/debugging:stacktrace",
|
|
|
|
"//third_party/abseil-cpp/absl/debugging:symbolize",
|
2022-08-29 17:59:48 +00:00
|
|
|
"//third_party/abseil-cpp/absl/functional:any_invocable",
|
2022-05-09 04:19:04 +00:00
|
|
|
"//third_party/abseil-cpp/absl/functional:bind_front",
|
2022-08-29 17:59:48 +00:00
|
|
|
"//third_party/abseil-cpp/absl/functional:function_ref",
|
2022-05-09 04:19:04 +00:00
|
|
|
"//third_party/abseil-cpp/absl/hash",
|
|
|
|
"//third_party/abseil-cpp/absl/memory",
|
|
|
|
"//third_party/abseil-cpp/absl/meta:type_traits",
|
|
|
|
"//third_party/abseil-cpp/absl/numeric:bits",
|
|
|
|
"//third_party/abseil-cpp/absl/numeric:int128",
|
2022-08-29 17:59:48 +00:00
|
|
|
"//third_party/abseil-cpp/absl/random",
|
2022-05-09 04:19:04 +00:00
|
|
|
"//third_party/abseil-cpp/absl/status",
|
|
|
|
"//third_party/abseil-cpp/absl/status:statusor",
|
|
|
|
"//third_party/abseil-cpp/absl/strings",
|
2022-08-29 17:59:48 +00:00
|
|
|
"//third_party/abseil-cpp/absl/strings:cord",
|
2022-05-09 04:19:04 +00:00
|
|
|
"//third_party/abseil-cpp/absl/strings:str_format",
|
|
|
|
"//third_party/abseil-cpp/absl/synchronization",
|
|
|
|
"//third_party/abseil-cpp/absl/time",
|
|
|
|
"//third_party/abseil-cpp/absl/types:optional",
|
|
|
|
"//third_party/abseil-cpp/absl/types:span",
|
|
|
|
"//third_party/abseil-cpp/absl/types:variant",
|
2022-08-29 17:59:48 +00:00
|
|
|
"//third_party/abseil-cpp/absl/utility",
|
2022-05-09 04:19:04 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
# The following dependencies currently don't build with NaCl.
|
|
|
|
# TODO(https://crbug.com/1114625): Fix build errors and remove this section.
|
|
|
|
if (is_nacl) {
|
|
|
|
public_deps -= [
|
|
|
|
"//third_party/abseil-cpp/absl/container:flat_hash_map",
|
|
|
|
"//third_party/abseil-cpp/absl/container:flat_hash_set",
|
|
|
|
"//third_party/abseil-cpp/absl/container:node_hash_map",
|
|
|
|
"//third_party/abseil-cpp/absl/container:node_hash_set",
|
|
|
|
"//third_party/abseil-cpp/absl/debugging:failure_signal_handler",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
visibility = [ ":absl" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
group("default") {
|
|
|
|
deps = [
|
|
|
|
"absl/types:any",
|
|
|
|
"absl/types:bad_any_cast",
|
|
|
|
"absl/types:bad_optional_access",
|
|
|
|
"absl/types:optional",
|
|
|
|
"absl/types:span",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
config("absl_include_config") {
|
|
|
|
include_dirs = [ "." ]
|
|
|
|
}
|
|
|
|
|
|
|
|
config("absl_define_config") {
|
|
|
|
defines = [ "ABSL_ALLOCATOR_NOTHROW=1" ]
|
|
|
|
|
|
|
|
if (is_win && !use_custom_libcxx) {
|
|
|
|
defines += [
|
|
|
|
# See crbug.com/1101367: Acknowledge extended alignment when using
|
|
|
|
# MSVC's standard library.
|
|
|
|
"_ENABLE_EXTENDED_ALIGNED_STORAGE",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
config("absl_default_cflags_cc") {
|
|
|
|
cflags_cc = []
|
|
|
|
if (is_clang) {
|
|
|
|
cflags_cc += [
|
|
|
|
# TODO(crbug.com/588506): Explicitly enable conversion warnings.
|
|
|
|
"-Wbool-conversion",
|
|
|
|
"-Wconstant-conversion",
|
|
|
|
"-Wenum-conversion",
|
|
|
|
"-Wint-conversion",
|
|
|
|
"-Wliteral-conversion",
|
|
|
|
"-Wnon-literal-null-conversion",
|
|
|
|
"-Wnull-conversion",
|
|
|
|
"-Wobjc-literal-conversion",
|
|
|
|
"-Wno-sign-conversion",
|
|
|
|
"-Wstring-conversion",
|
|
|
|
]
|
2022-08-29 17:59:48 +00:00
|
|
|
if (!is_nacl) {
|
2022-05-09 04:19:04 +00:00
|
|
|
cflags_cc += [ "-Wbitfield-enum-conversion" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
config("absl_test_cflags_cc") {
|
|
|
|
cflags_cc = []
|
|
|
|
if (is_clang || !is_win) {
|
|
|
|
cflags_cc += [
|
|
|
|
"-Wno-conversion-null",
|
|
|
|
"-Wno-missing-declarations",
|
|
|
|
"-Wno-sign-compare",
|
|
|
|
"-Wno-unused-function",
|
|
|
|
"-Wno-unused-parameter",
|
|
|
|
"-Wno-unused-private-field",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
if (is_win) {
|
|
|
|
cflags_cc += [
|
|
|
|
"/wd4018", # signed/unsigned mismatch
|
|
|
|
"/wd4101", # unreferenced local variable
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (build_with_chromium) {
|
|
|
|
import("//testing/test.gni")
|
|
|
|
|
|
|
|
if (!is_component_build) {
|
|
|
|
test("absl_tests") {
|
|
|
|
testonly = true
|
|
|
|
deps = [
|
|
|
|
"absl/algorithm:algorithm_test",
|
|
|
|
"absl/algorithm:container_test",
|
|
|
|
"absl/base:config_test",
|
2022-08-29 17:59:48 +00:00
|
|
|
"absl/base:prefetch_test",
|
2022-05-09 04:19:04 +00:00
|
|
|
"absl/cleanup:cleanup_test",
|
|
|
|
"absl/container:inlined_vector_test",
|
2022-08-29 17:59:48 +00:00
|
|
|
"absl/container:node_slot_policy_test",
|
|
|
|
"absl/container:sample_element_size_test",
|
|
|
|
"absl/functional:any_invocable_test",
|
|
|
|
"absl/hash:hash_test",
|
2022-05-09 04:19:04 +00:00
|
|
|
"absl/hash:low_level_hash_test",
|
|
|
|
"absl/memory:memory_test",
|
|
|
|
"absl/meta:type_traits_test",
|
2022-08-29 17:59:48 +00:00
|
|
|
"absl/profiling:exponential_biased_test",
|
|
|
|
"absl/profiling:periodic_sampler_test",
|
2022-05-09 04:19:04 +00:00
|
|
|
"absl/status:statusor_test",
|
|
|
|
"absl/strings:ascii_test",
|
2022-08-29 17:59:48 +00:00
|
|
|
"absl/strings:cord_buffer_test",
|
|
|
|
"absl/strings:cord_data_edge_test",
|
|
|
|
"absl/strings:cord_rep_btree_navigator_test",
|
2022-05-09 04:19:04 +00:00
|
|
|
"absl/strings:cord_rep_btree_reader_test",
|
2022-08-29 17:59:48 +00:00
|
|
|
"absl/strings:cord_rep_btree_test",
|
|
|
|
"absl/strings:cord_rep_crc_test",
|
2022-05-09 04:19:04 +00:00
|
|
|
"absl/strings:cordz_functions_test",
|
|
|
|
"absl/strings:cordz_info_statistics_test",
|
|
|
|
"absl/strings:cordz_info_test",
|
|
|
|
"absl/strings:cordz_test",
|
|
|
|
"absl/strings:cordz_update_scope_test",
|
|
|
|
"absl/strings:cordz_update_tracker_test",
|
|
|
|
"absl/strings:match_test",
|
|
|
|
"absl/strings:str_replace_test",
|
|
|
|
"absl/strings:string_view_test",
|
|
|
|
"absl/types:optional_test",
|
|
|
|
"absl/types:variant_test",
|
|
|
|
"//third_party/googletest:gtest_main",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
test("absl_hardening_tests") {
|
|
|
|
testonly = true
|
|
|
|
sources = [ "absl_hardening_test.cc" ]
|
|
|
|
deps = [
|
|
|
|
"//base/test:run_all_unittests",
|
|
|
|
"//third_party/abseil-cpp/absl/base:config",
|
|
|
|
"//third_party/abseil-cpp/absl/container:fixed_array",
|
|
|
|
"//third_party/abseil-cpp/absl/container:inlined_vector",
|
|
|
|
"//third_party/abseil-cpp/absl/strings",
|
|
|
|
"//third_party/abseil-cpp/absl/types:optional",
|
|
|
|
"//third_party/abseil-cpp/absl/types:span",
|
|
|
|
"//third_party/abseil-cpp/absl/types:variant",
|
|
|
|
"//third_party/googletest:gtest",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|