• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2018 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_overrides/build.gni")
6import("//third_party/abseil-cpp/absl.gni")
7
8absl_source_set("hash") {
9  sources = [
10    "internal/hash.cc",
11    "internal/hash.h",
12  ]
13  public = [ "hash.h" ]
14  deps = [
15    ":city",
16    ":low_level_hash",
17    "//third_party/abseil-cpp/absl/base:config",
18    "//third_party/abseil-cpp/absl/base:core_headers",
19    "//third_party/abseil-cpp/absl/base:endian",
20    "//third_party/abseil-cpp/absl/container:fixed_array",
21    "//third_party/abseil-cpp/absl/functional:function_ref",
22    "//third_party/abseil-cpp/absl/meta:type_traits",
23    "//third_party/abseil-cpp/absl/numeric:bits",
24    "//third_party/abseil-cpp/absl/numeric:int128",
25    "//third_party/abseil-cpp/absl/strings:string_view",
26    "//third_party/abseil-cpp/absl/types:optional",
27    "//third_party/abseil-cpp/absl/types:variant",
28    "//third_party/abseil-cpp/absl/utility",
29  ]
30}
31
32absl_source_set("hash_testing") {
33  testonly = true
34  public = [ "hash_testing.h" ]
35  deps = [
36    ":spy_hash_state",
37    "//third_party/abseil-cpp/absl/meta:type_traits",
38    "//third_party/abseil-cpp/absl/strings",
39    "//third_party/abseil-cpp/absl/types:variant",
40    "//third_party/googletest:gtest",
41  ]
42}
43
44absl_test("hash_test") {
45  sources = [
46    "hash_test.cc",
47    "internal/hash_test.h",
48  ]
49  deps = [
50    ":hash",
51    ":hash_testing",
52    ":spy_hash_state",
53    "//third_party/abseil-cpp/absl/base:config",
54    "//third_party/abseil-cpp/absl/base:core_headers",
55    "//third_party/abseil-cpp/absl/container:btree",
56    "//third_party/abseil-cpp/absl/container:flat_hash_map",
57    "//third_party/abseil-cpp/absl/container:flat_hash_set",
58    "//third_party/abseil-cpp/absl/container:node_hash_map",
59    "//third_party/abseil-cpp/absl/container:node_hash_set",
60    "//third_party/abseil-cpp/absl/meta:type_traits",
61    "//third_party/abseil-cpp/absl/numeric:int128",
62    "//third_party/abseil-cpp/absl/strings:cord_test_helpers",
63  ]
64}
65
66absl_test("hash_instantiated_test") {
67  sources = [
68    "hash_instantiated_test.cc",
69    "internal/hash_test.h",
70  ]
71  deps = [
72    ":hash",
73    ":hash_testing",
74    "//third_party/abseil-cpp/absl/base:config",
75    "//third_party/abseil-cpp/absl/container:btree",
76    "//third_party/abseil-cpp/absl/container:flat_hash_map",
77    "//third_party/abseil-cpp/absl/container:flat_hash_set",
78    "//third_party/abseil-cpp/absl/container:node_hash_map",
79    "//third_party/abseil-cpp/absl/container:node_hash_set",
80  ]
81}
82
83absl_source_set("spy_hash_state") {
84  testonly = true
85  public = [ "internal/spy_hash_state.h" ]
86  deps = [
87    ":hash",
88    "//third_party/abseil-cpp/absl/strings",
89    "//third_party/abseil-cpp/absl/strings:str_format",
90  ]
91  visibility = [ "//third_party/abseil-cpp/absl/*" ]
92}
93
94absl_source_set("city") {
95  public = [ "internal/city.h" ]
96  sources = [ "internal/city.cc" ]
97  deps = [
98    "//third_party/abseil-cpp/absl/base:config",
99    "//third_party/abseil-cpp/absl/base:core_headers",
100    "//third_party/abseil-cpp/absl/base:endian",
101  ]
102}
103
104absl_source_set("low_level_hash") {
105  public = [ "internal/low_level_hash.h" ]
106  sources = [ "internal/low_level_hash.cc" ]
107  deps = [
108    "//third_party/abseil-cpp/absl/base:config",
109    "//third_party/abseil-cpp/absl/base:endian",
110    "//third_party/abseil-cpp/absl/base:prefetch",
111    "//third_party/abseil-cpp/absl/numeric:int128",
112  ]
113  visibility = [ ":*" ]
114}
115
116absl_test("low_level_hash_test") {
117  sources = [ "internal/low_level_hash_test.cc" ]
118  deps = [
119    ":low_level_hash",
120    "//third_party/abseil-cpp/absl/strings",
121  ]
122}
123