blob: d30097ae3cd503746ffdf3c764fdef1ccc103d64 [file] [log] [blame]
# Copyright 2017 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.
assert(!is_ios)
import("//build/buildflag_header.gni")
import("//build/config/compiler/compiler.gni")
import("//testing/test.gni")
import("//third_party/blink/public/public_features.gni")
import("//third_party/blink/renderer/config.gni")
buildflag_header("buildflags") {
header = "buildflags.h"
header_dir = "third_party/blink/renderer/platform/wtf"
flags = [ "USE_V8_OILPAN=$enable_blink_heap_use_v8_oilpan" ]
}
visibility = [
":*",
"//:gn_all",
"//mojo/public/cpp/bindings/*",
"//third_party/blink/*",
]
config("wtf_config") {
if (is_win) {
cflags = [
# Don't complain about calling specific versions of templatized
# functions (e.g. in RefPtrHashMap.h).
"/wd4344",
]
if (is_component_build) {
# Chromium windows multi-dll build enables C++ exceptions and this causes
# wtf to generate 4291 warning due to operator new/delete
# implementations. Disable the warning for chromium windows multi-dll
# build.
cflags += [ "/wd4291" ]
}
}
}
component("wtf") {
configs += [ "//build/config/compiler:noshadowing" ]
sources = [
"allocator/allocator.cc",
"allocator/allocator.h",
"allocator/partition_allocator.cc",
"allocator/partition_allocator.h",
"allocator/partitions.cc",
"allocator/partitions.h",
"assertions.cc",
"assertions.h",
"bit_field.h",
"bloom_filter.h",
"casting.h",
"conditional_destructor.h",
"container_annotations.h",
"cross_thread_copier.cc",
"cross_thread_copier.h",
"cross_thread_functional.h",
"date_math.cc",
"date_math.h",
"decimal.cc",
"decimal.h",
"deque.h",
"doubly_linked_list.h",
"dtoa.cc",
"dtoa.h",
"dynamic_annotations.cc",
"dynamic_annotations.h",
"forward.h",
"functional.h",
"get_ptr.h",
"hash_counted_set.h",
"hash_functions.h",
"hash_iterators.h",
"hash_map.h",
"hash_set.h",
"hash_table.cc",
"hash_table.h",
"hash_table_deleted_value_type.h",
"hash_traits.h",
"leak_annotations.h",
"linked_hash_set.h",
"list_hash_set.h",
"lru_cache.h",
"math_extras.h",
"pod_arena.h",
"pod_free_list_arena.h",
"pod_interval.h",
"pod_interval_tree.h",
"pod_red_black_tree.h",
"ref_counted.h",
"sanitizers.h",
"scoped_logger.cc",
"scoped_logger.h",
"sequence_bound.h",
"shared_buffer.cc",
"shared_buffer.h",
"size_assertions.cc",
"size_assertions.h",
"stack_util.cc",
"stack_util.h",
"static_constructors.h",
"std_lib_extras.h",
"text/ascii_ctype.cc",
"text/ascii_ctype.h",
"text/ascii_fast_path.h",
"text/atomic_string.cc",
"text/atomic_string.h",
"text/atomic_string_cf.cc",
"text/atomic_string_hash.h",
"text/atomic_string_table.cc",
"text/atomic_string_table.h",
"text/base64.cc",
"text/base64.h",
"text/case_folding_hash.h",
"text/case_map.cc",
"text/case_map.h",
"text/character_names.h",
"text/character_visitor.h",
"text/integer_to_string_conversion.h",
"text/line_ending.cc",
"text/line_ending.h",
"text/math_transform.cc",
"text/math_transform.h",
"text/number_parsing_options.h",
"text/parsing_utilities.h",
"text/string_buffer.h",
"text/string_builder.cc",
"text/string_builder.h",
"text/string_concatenate.cc",
"text/string_concatenate.h",
"text/string_hash.h",
"text/string_hasher.h",
"text/string_impl.cc",
"text/string_impl.h",
"text/string_operators.h",
"text/string_statics.cc",
"text/string_statics.h",
"text/string_to_number.cc",
"text/string_to_number.h",
"text/string_utf8_adaptor.cc",
"text/string_utf8_adaptor.h",
"text/string_view.cc",
"text/string_view.h",
"text/text_codec.cc",
"text/text_codec.h",
"text/text_codec_ascii_fast_path.h",
"text/text_codec_icu.cc",
"text/text_codec_icu.h",
"text/text_codec_latin1.cc",
"text/text_codec_latin1.h",
"text/text_codec_replacement.cc",
"text/text_codec_replacement.h",
"text/text_codec_user_defined.cc",
"text/text_codec_user_defined.h",
"text/text_codec_utf16.cc",
"text/text_codec_utf16.h",
"text/text_codec_utf8.cc",
"text/text_codec_utf8.h",
"text/text_encoding.cc",
"text/text_encoding.h",
"text/text_encoding_registry.cc",
"text/text_encoding_registry.h",
"text/text_offset_map.cc",
"text/text_offset_map.h",
"text/text_position.cc",
"text/text_position.h",
"text/text_stream.cc",
"text/text_stream.h",
"text/unicode.h",
"text/unicode_string.h",
"text/utf8.cc",
"text/utf8.h",
"text/wtf_string.cc",
"text/wtf_string.h",
"text/wtf_uchar.h",
"thread_restriction_verifier.h",
"thread_safe_ref_counted.h",
"thread_specific.h",
"threading.cc",
"threading.h",
"threading_primitives.h",
"type_traits.h",
"uuid.cc",
"uuid.h",
"vector.h",
"vector_backed_linked_list.h",
"vector_traits.h",
"wtf.cc",
"wtf.h",
"wtf_export.h",
"wtf_size_t.h",
]
configs += [
"//third_party/blink/renderer:config",
"//third_party/blink/renderer:non_test_config",
"//third_party/blink/renderer:blink_pch",
]
defines = [ "WTF_IMPLEMENTATION=1" ]
public_configs = [
":wtf_config",
"//third_party/blink/renderer:features",
]
deps = [
":buildflags",
"//base/allocator:buildflags",
"//build:chromeos_buildflags",
# TODO(tkent): WTF should not depend on it.
"//third_party/blink/public/common:headers",
]
public_deps = [
"//base",
"//base/third_party/double_conversion",
"//components/crash/core/common:crash_key",
"//third_party/icu",
]
if (enable_blink_heap_use_v8_oilpan) {
public_deps += [ "//v8:cppgc_headers" ]
}
# Rules changing the |sources| list are temporarily commented out, until
# those files are actually moved to here.
if (is_mac) {
sources += [
"text/string_impl_mac.mm",
"text/string_mac.mm",
]
}
if (is_win) {
sources += [ "threading_win.cc" ]
cflags = [ "/wd4068" ] # Unknown pragma.
# Inject Visual Studio debug visualizers for our types into all targets
# that reference this.
all_dependent_configs = [ "//tools/win/DebugVisualizers:blink" ]
inputs = [
# blink.natvis listed as an input here instead of in
# //tools/win/DebugVisualizers:blink to prevent unnecessary size increase
# in generated build files.
"//tools/win/DebugVisualizers/blink.natvis",
]
} else {
sources += [ "threading_pthreads.cc" ]
}
if (is_android) {
libs = [ "log" ]
}
if (is_mac) {
frameworks = [
"CoreFoundation.framework",
"Foundation.framework",
]
} else {
sources -= [ "text/atomic_string_cf.cc" ]
}
if (using_mismatched_sample_profile) {
configs -= [ "//build/config/compiler:afdo_optimize_size" ]
}
configs -= [ "//build/config/compiler:default_symbols" ]
configs += blink_symbols_config
}
test("wtf_unittests") {
deps = [ ":wtf_unittests_sources" ]
}
source_set("wtf_unittests_sources") {
visibility = [] # Allow re-assignment of list.
visibility = [ "*" ]
testonly = true
sources = [
"allocator/atomic_operations_test.cc",
"allocator/partitions_test.cc",
"ascii_ctype_test.cc",
"assertions_test.cc",
"bit_field_test.cc",
"cross_thread_functional_test.cc",
"decimal_test.cc",
"deque_test.cc",
"doubly_linked_list_test.cc",
"dtoa_test.cc",
"functional_test.cc",
"hash_map_test.cc",
"hash_set_test.cc",
"linked_hash_set_test.cc",
"list_hash_set_test.cc",
"lru_cache_test.cc",
"math_extras_test.cc",
"pod_arena_test.cc",
"pod_arena_test_helpers.h",
"pod_free_list_arena_test.cc",
"pod_interval_tree_test.cc",
"pod_red_black_tree_test.cc",
"pod_tree_test_helpers.cc",
"pod_tree_test_helpers.h",
"scoped_logger_test.cc",
"sequence_bound_test.cc",
"shared_buffer_test.cc",
"testing/run_all_tests.cc",
"text/atomic_string_table_test.cc",
"text/atomic_string_test.cc",
"text/case_map_test.cc",
"text/integer_to_string_conversion_test.cc",
"text/line_ending_test.cc",
"text/math_transform_test.cc",
"text/string_buffer_test.cc",
"text/string_builder_test.cc",
"text/string_hasher_test.cc",
"text/string_impl_test.cc",
"text/string_to_number_test.cc",
"text/string_view_test.cc",
"text/text_codec_icu_test.cc",
"text/text_codec_replacement_test.cc",
"text/text_codec_test.cc",
"text/text_codec_utf8_test.cc",
"text/text_encoding_test.cc",
"text/wtf_string_test.cc",
"threading_primitives_test.cc",
"type_traits_test.cc",
"uuid_test.cc",
"vector_backed_linked_list_test.cc",
"vector_test.cc",
]
if (is_win) {
cflags = [ "/wd4068" ] # Unknown pragma.
}
configs += [
"//third_party/blink/renderer:config",
"//third_party/blink/renderer:blink_pch",
]
deps = [
":wtf",
"//base",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
}