Give names to all utility processes.
[chromium-blink-merge.git] / build / secondary / third_party / leveldatabase / BUILD.gn
blobca5d65d5b8e25d752bfed0bf91e0c89f611a4af3
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 # Snappy is a compression library we use.
6 # TODO(brettw) It's not clear why this needs to be parameterized.
8 import("//testing/test.gni")
10 use_snappy = true
12 defines = [ "LEVELDB_PLATFORM_CHROMIUM=1" ]
14 config("leveldatabase_config") {
15   include_dirs = [
16     ".",
17     "src",
18     "src/include",
19   ]
22 static_library("leveldatabase") {
23   sources = [
24     "env_chromium.cc",
25     "env_chromium.h",
26     "env_idb.h",
27     "port/port_chromium.cc",
28     "port/port_chromium.h",
29     "src/db/builder.cc",
30     "src/db/builder.h",
31     "src/db/db_impl.cc",
32     "src/db/db_impl.h",
33     "src/db/db_iter.cc",
34     "src/db/db_iter.h",
35     "src/db/dbformat.cc",
36     "src/db/dbformat.h",
37     "src/db/dumpfile.cc",
38     "src/db/filename.cc",
39     "src/db/filename.h",
40     "src/db/log_format.h",
41     "src/db/log_reader.cc",
42     "src/db/log_reader.h",
43     "src/db/log_writer.cc",
44     "src/db/log_writer.h",
45     "src/db/memtable.cc",
46     "src/db/memtable.h",
47     "src/db/repair.cc",
48     "src/db/skiplist.h",
49     "src/db/snapshot.h",
50     "src/db/table_cache.cc",
51     "src/db/table_cache.h",
52     "src/db/version_edit.cc",
53     "src/db/version_edit.h",
54     "src/db/version_set.cc",
55     "src/db/version_set.h",
56     "src/db/write_batch.cc",
57     "src/db/write_batch_internal.h",
58     "src/helpers/memenv/memenv.cc",
59     "src/helpers/memenv/memenv.h",
60     "src/include/leveldb/cache.h",
61     "src/include/leveldb/comparator.h",
62     "src/include/leveldb/db.h",
63     "src/include/leveldb/dumpfile.h",
64     "src/include/leveldb/env.h",
65     "src/include/leveldb/filter_policy.h",
66     "src/include/leveldb/iterator.h",
67     "src/include/leveldb/options.h",
68     "src/include/leveldb/slice.h",
69     "src/include/leveldb/status.h",
70     "src/include/leveldb/table.h",
71     "src/include/leveldb/table_builder.h",
72     "src/include/leveldb/write_batch.h",
73     "src/port/port.h",
74     "src/port/port_example.h",
76     #"src/port/port_posix.cc",  # We use the chromium port instead of this.
77     #"src/port/port_posix.h",
78     "src/table/block.cc",
79     "src/table/block.h",
80     "src/table/block_builder.cc",
81     "src/table/block_builder.h",
82     "src/table/filter_block.cc",
83     "src/table/filter_block.h",
84     "src/table/format.cc",
85     "src/table/format.h",
86     "src/table/iterator.cc",
87     "src/table/iterator_wrapper.h",
88     "src/table/merger.cc",
89     "src/table/merger.h",
90     "src/table/table.cc",
91     "src/table/table_builder.cc",
92     "src/table/two_level_iterator.cc",
93     "src/table/two_level_iterator.h",
94     "src/util/arena.cc",
95     "src/util/arena.h",
96     "src/util/bloom.cc",
97     "src/util/cache.cc",
98     "src/util/coding.cc",
99     "src/util/coding.h",
100     "src/util/comparator.cc",
101     "src/util/crc32c.cc",
102     "src/util/crc32c.h",
103     "src/util/env.cc",
104     "src/util/filter_policy.cc",
105     "src/util/hash.cc",
106     "src/util/hash.h",
107     "src/util/logging.cc",
108     "src/util/logging.h",
109     "src/util/mutexlock.h",
110     "src/util/options.cc",
111     "src/util/random.h",
112     "src/util/status.cc",
113   ]
115   configs -= [ "//build/config/compiler:chromium_code" ]
116   configs += [ "//build/config/compiler:no_chromium_code" ]
118   public_configs = [ ":leveldatabase_config" ]
120   deps = [
121     "//base",
122     "//base/third_party/dynamic_annotations",
123     "//third_party/re2",
124   ]
126   if (use_snappy) {
127     defines += [ "USE_SNAPPY=1" ]
128     deps += [ "//third_party/snappy" ]
129   }
132 if (!is_android) {
133   test("env_chromium_unittests") {
134     sources = [
135       "env_chromium_unittest.cc",
136     ]
137     deps = [
138       ":leveldatabase",
139       "//base/test:test_support",
140       "//testing/gtest",
141     ]
142   }
144   static_library("leveldb_testutil") {
145     sources = [
146       "src/util/histogram.cc",
147       "src/util/histogram.h",
148       "src/util/testharness.cc",
149       "src/util/testharness.h",
150       "src/util/testutil.cc",
151       "src/util/testutil.h",
152     ]
154     configs -= [ "//build/config/compiler:chromium_code" ]
155     configs += [ "//build/config/compiler:no_chromium_code" ]
157     public_deps = [
158       ":leveldatabase",
159     ]
160     deps = [
161       "//base",
162     ]
163   }
165   test("leveldb_arena_test") {
166     sources = [
167       "src/util/arena_test.cc",
168     ]
169     configs -= [ "//build/config/compiler:chromium_code" ]
170     configs += [ "//build/config/compiler:no_chromium_code" ]
171     deps = [
172       ":leveldb_testutil",
173     ]
174   }
176   test("leveldb_bloom_test") {
177     sources = [
178       "src/util/bloom_test.cc",
179     ]
180     configs -= [ "//build/config/compiler:chromium_code" ]
181     configs += [ "//build/config/compiler:no_chromium_code" ]
182     deps = [
183       ":leveldb_testutil",
184     ]
185   }
187   test("leveldb_cache_test") {
188     sources = [
189       "src/util/cache_test.cc",
190     ]
191     configs -= [ "//build/config/compiler:chromium_code" ]
192     configs += [ "//build/config/compiler:no_chromium_code" ]
193     deps = [
194       ":leveldb_testutil",
195     ]
196   }
198   test("leveldb_corruption_test") {
199     sources = [
200       "src/db/corruption_test.cc",
201     ]
202     configs -= [ "//build/config/compiler:chromium_code" ]
203     configs += [ "//build/config/compiler:no_chromium_code" ]
204     deps = [
205       ":leveldb_testutil",
206     ]
207   }
209   test("leveldb_crc32c_test") {
210     sources = [
211       "src/util/crc32c_test.cc",
212     ]
213     configs -= [ "//build/config/compiler:chromium_code" ]
214     configs += [ "//build/config/compiler:no_chromium_code" ]
215     deps = [
216       ":leveldb_testutil",
217     ]
218   }
220   test("leveldb_db_bench") {
221     sources = [
222       "src/db/db_bench.cc",
223     ]
224     configs -= [ "//build/config/compiler:chromium_code" ]
225     configs += [ "//build/config/compiler:no_chromium_code" ]
226     deps = [
227       ":leveldb_testutil",
228     ]
229   }
231   test("leveldb_db_test") {
232     sources = [
233       "src/db/db_test.cc",
234     ]
235     configs -= [ "//build/config/compiler:chromium_code" ]
236     configs += [ "//build/config/compiler:no_chromium_code" ]
237     deps = [
238       ":leveldb_testutil",
239     ]
240   }
242   test("leveldb_dbformat_test") {
243     sources = [
244       "src/db/dbformat_test.cc",
245     ]
246     configs -= [ "//build/config/compiler:chromium_code" ]
247     configs += [ "//build/config/compiler:no_chromium_code" ]
248     deps = [
249       ":leveldb_testutil",
250     ]
251   }
253   test("leveldb_env_test") {
254     sources = [
255       "src/util/env_test.cc",
256     ]
257     configs -= [ "//build/config/compiler:chromium_code" ]
258     configs += [ "//build/config/compiler:no_chromium_code" ]
259     deps = [
260       ":leveldb_testutil",
261     ]
262   }
264   test("leveldb_filename_test") {
265     sources = [
266       "src/db/filename_test.cc",
267     ]
268     configs -= [ "//build/config/compiler:chromium_code" ]
269     configs += [ "//build/config/compiler:no_chromium_code" ]
270     deps = [
271       ":leveldb_testutil",
272     ]
273   }
275   test("leveldb_filter_block_test") {
276     sources = [
277       "src/table/filter_block_test.cc",
278     ]
279     configs -= [ "//build/config/compiler:chromium_code" ]
280     configs += [ "//build/config/compiler:no_chromium_code" ]
281     deps = [
282       ":leveldb_testutil",
283     ]
284   }
286   test("leveldb_log_test") {
287     sources = [
288       "src/db/log_test.cc",
289     ]
290     configs -= [ "//build/config/compiler:chromium_code" ]
291     configs += [ "//build/config/compiler:no_chromium_code" ]
292     deps = [
293       ":leveldb_testutil",
294     ]
295   }
297   test("leveldb_skiplist_test") {
298     sources = [
299       "src/db/skiplist_test.cc",
300     ]
301     configs -= [ "//build/config/compiler:chromium_code" ]
302     configs += [ "//build/config/compiler:no_chromium_code" ]
303     deps = [
304       ":leveldb_testutil",
305     ]
306   }
308   test("leveldb_table_test") {
309     sources = [
310       "src/table/table_test.cc",
311     ]
312     configs -= [ "//build/config/compiler:chromium_code" ]
313     configs += [ "//build/config/compiler:no_chromium_code" ]
314     deps = [
315       ":leveldb_testutil",
316     ]
317   }
319   test("leveldb_version_edit_test") {
320     sources = [
321       "src/db/version_edit_test.cc",
322     ]
323     configs -= [ "//build/config/compiler:chromium_code" ]
324     configs += [ "//build/config/compiler:no_chromium_code" ]
325     deps = [
326       ":leveldb_testutil",
327     ]
328   }
330   test("leveldb_write_batch_test") {
331     sources = [
332       "src/db/write_batch_test.cc",
333     ]
334     configs -= [ "//build/config/compiler:chromium_code" ]
335     configs += [ "//build/config/compiler:no_chromium_code" ]
336     deps = [
337       ":leveldb_testutil",
338     ]
339   }