Update mojo sdk to rev 1dc8a9a5db73d3718d99917fadf31f5fb2ebad4f
[chromium-blink-merge.git] / third_party / leveldatabase / BUILD.gn
blobca51867d856397a4e054fc5a3d8c4a2e0eeea339
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 import("//testing/test.gni")
7 defines = [ "LEVELDB_PLATFORM_CHROMIUM=1" ]
9 config("leveldatabase_config") {
10   include_dirs = [
11     ".",
12     "src",
13     "src/include",
14   ]
17 static_library("leveldatabase") {
18   sources = [
19     "env_chromium.cc",
20     "env_chromium.h",
21     "env_idb.h",
22     "port/port_chromium.cc",
23     "port/port_chromium.h",
24     "src/db/builder.cc",
25     "src/db/builder.h",
26     "src/db/db_impl.cc",
27     "src/db/db_impl.h",
28     "src/db/db_iter.cc",
29     "src/db/db_iter.h",
30     "src/db/dbformat.cc",
31     "src/db/dbformat.h",
32     "src/db/dumpfile.cc",
33     "src/db/filename.cc",
34     "src/db/filename.h",
35     "src/db/log_format.h",
36     "src/db/log_reader.cc",
37     "src/db/log_reader.h",
38     "src/db/log_writer.cc",
39     "src/db/log_writer.h",
40     "src/db/memtable.cc",
41     "src/db/memtable.h",
42     "src/db/repair.cc",
43     "src/db/skiplist.h",
44     "src/db/snapshot.h",
45     "src/db/table_cache.cc",
46     "src/db/table_cache.h",
47     "src/db/version_edit.cc",
48     "src/db/version_edit.h",
49     "src/db/version_set.cc",
50     "src/db/version_set.h",
51     "src/db/write_batch.cc",
52     "src/db/write_batch_internal.h",
53     "src/helpers/memenv/memenv.cc",
54     "src/helpers/memenv/memenv.h",
55     "src/include/leveldb/cache.h",
56     "src/include/leveldb/comparator.h",
57     "src/include/leveldb/db.h",
58     "src/include/leveldb/dumpfile.h",
59     "src/include/leveldb/env.h",
60     "src/include/leveldb/filter_policy.h",
61     "src/include/leveldb/iterator.h",
62     "src/include/leveldb/options.h",
63     "src/include/leveldb/slice.h",
64     "src/include/leveldb/status.h",
65     "src/include/leveldb/table.h",
66     "src/include/leveldb/table_builder.h",
67     "src/include/leveldb/write_batch.h",
68     "src/port/port.h",
69     "src/table/block.cc",
70     "src/table/block.h",
71     "src/table/block_builder.cc",
72     "src/table/block_builder.h",
73     "src/table/filter_block.cc",
74     "src/table/filter_block.h",
75     "src/table/format.cc",
76     "src/table/format.h",
77     "src/table/iterator.cc",
78     "src/table/iterator_wrapper.h",
79     "src/table/merger.cc",
80     "src/table/merger.h",
81     "src/table/table.cc",
82     "src/table/table_builder.cc",
83     "src/table/two_level_iterator.cc",
84     "src/table/two_level_iterator.h",
85     "src/util/arena.cc",
86     "src/util/arena.h",
87     "src/util/bloom.cc",
88     "src/util/cache.cc",
89     "src/util/coding.cc",
90     "src/util/coding.h",
91     "src/util/comparator.cc",
92     "src/util/crc32c.cc",
93     "src/util/crc32c.h",
94     "src/util/env.cc",
95     "src/util/filter_policy.cc",
96     "src/util/hash.cc",
97     "src/util/hash.h",
98     "src/util/logging.cc",
99     "src/util/logging.h",
100     "src/util/mutexlock.h",
101     "src/util/options.cc",
102     "src/util/random.h",
103     "src/util/status.cc",
104   ]
106   configs -= [ "//build/config/compiler:chromium_code" ]
107   configs += [ "//build/config/compiler:no_chromium_code" ]
109   public_configs = [ ":leveldatabase_config" ]
111   deps = [
112     "//base",
113     "//base/third_party/dynamic_annotations",
114     "//third_party/re2",
115     "//third_party/snappy",
116   ]
119 if (!is_android) {
120   test("env_chromium_unittests") {
121     sources = [
122       "env_chromium_unittest.cc",
123     ]
124     deps = [
125       ":leveldatabase",
126       "//base/test:test_support",
127       "//testing/gtest",
128     ]
129   }
131   static_library("leveldb_testutil") {
132     sources = [
133       "src/util/histogram.cc",
134       "src/util/histogram.h",
135       "src/util/testharness.cc",
136       "src/util/testharness.h",
137       "src/util/testutil.cc",
138       "src/util/testutil.h",
139     ]
141     configs -= [ "//build/config/compiler:chromium_code" ]
142     configs += [ "//build/config/compiler:no_chromium_code" ]
144     public_deps = [
145       ":leveldatabase",
146     ]
147     deps = [
148       "//base",
149     ]
150   }
152   test("leveldb_arena_test") {
153     sources = [
154       "src/util/arena_test.cc",
155     ]
156     configs -= [ "//build/config/compiler:chromium_code" ]
157     configs += [ "//build/config/compiler:no_chromium_code" ]
158     deps = [
159       ":leveldb_testutil",
160     ]
161   }
163   test("leveldb_bloom_test") {
164     sources = [
165       "src/util/bloom_test.cc",
166     ]
167     configs -= [ "//build/config/compiler:chromium_code" ]
168     configs += [ "//build/config/compiler:no_chromium_code" ]
169     deps = [
170       ":leveldb_testutil",
171     ]
172   }
174   test("leveldb_cache_test") {
175     sources = [
176       "src/util/cache_test.cc",
177     ]
178     configs -= [ "//build/config/compiler:chromium_code" ]
179     configs += [ "//build/config/compiler:no_chromium_code" ]
180     deps = [
181       ":leveldb_testutil",
182     ]
183   }
185   test("leveldb_corruption_test") {
186     sources = [
187       "src/db/corruption_test.cc",
188     ]
189     configs -= [ "//build/config/compiler:chromium_code" ]
190     configs += [ "//build/config/compiler:no_chromium_code" ]
191     deps = [
192       ":leveldb_testutil",
193     ]
194   }
196   test("leveldb_crc32c_test") {
197     sources = [
198       "src/util/crc32c_test.cc",
199     ]
200     configs -= [ "//build/config/compiler:chromium_code" ]
201     configs += [ "//build/config/compiler:no_chromium_code" ]
202     deps = [
203       ":leveldb_testutil",
204     ]
205   }
207   test("leveldb_db_bench") {
208     sources = [
209       "src/db/db_bench.cc",
210     ]
211     configs -= [ "//build/config/compiler:chromium_code" ]
212     configs += [ "//build/config/compiler:no_chromium_code" ]
213     deps = [
214       ":leveldb_testutil",
215     ]
216   }
218   test("leveldb_db_test") {
219     sources = [
220       "src/db/db_test.cc",
221     ]
222     configs -= [ "//build/config/compiler:chromium_code" ]
223     configs += [ "//build/config/compiler:no_chromium_code" ]
224     deps = [
225       ":leveldb_testutil",
226     ]
227   }
229   test("leveldb_dbformat_test") {
230     sources = [
231       "src/db/dbformat_test.cc",
232     ]
233     configs -= [ "//build/config/compiler:chromium_code" ]
234     configs += [ "//build/config/compiler:no_chromium_code" ]
235     deps = [
236       ":leveldb_testutil",
237     ]
238   }
240   test("leveldb_env_test") {
241     sources = [
242       "src/util/env_test.cc",
243     ]
244     configs -= [ "//build/config/compiler:chromium_code" ]
245     configs += [ "//build/config/compiler:no_chromium_code" ]
246     deps = [
247       ":leveldb_testutil",
248     ]
249   }
251   test("leveldb_filename_test") {
252     sources = [
253       "src/db/filename_test.cc",
254     ]
255     configs -= [ "//build/config/compiler:chromium_code" ]
256     configs += [ "//build/config/compiler:no_chromium_code" ]
257     deps = [
258       ":leveldb_testutil",
259     ]
260   }
262   test("leveldb_filter_block_test") {
263     sources = [
264       "src/table/filter_block_test.cc",
265     ]
266     configs -= [ "//build/config/compiler:chromium_code" ]
267     configs += [ "//build/config/compiler:no_chromium_code" ]
268     deps = [
269       ":leveldb_testutil",
270     ]
271   }
273   test("leveldb_log_test") {
274     sources = [
275       "src/db/log_test.cc",
276     ]
277     configs -= [ "//build/config/compiler:chromium_code" ]
278     configs += [ "//build/config/compiler:no_chromium_code" ]
279     deps = [
280       ":leveldb_testutil",
281     ]
282   }
284   test("leveldb_skiplist_test") {
285     sources = [
286       "src/db/skiplist_test.cc",
287     ]
288     configs -= [ "//build/config/compiler:chromium_code" ]
289     configs += [ "//build/config/compiler:no_chromium_code" ]
290     deps = [
291       ":leveldb_testutil",
292     ]
293   }
295   test("leveldb_table_test") {
296     sources = [
297       "src/table/table_test.cc",
298     ]
299     configs -= [ "//build/config/compiler:chromium_code" ]
300     configs += [ "//build/config/compiler:no_chromium_code" ]
301     deps = [
302       ":leveldb_testutil",
303     ]
304   }
306   test("leveldb_version_edit_test") {
307     sources = [
308       "src/db/version_edit_test.cc",
309     ]
310     configs -= [ "//build/config/compiler:chromium_code" ]
311     configs += [ "//build/config/compiler:no_chromium_code" ]
312     deps = [
313       ":leveldb_testutil",
314     ]
315   }
317   test("leveldb_write_batch_test") {
318     sources = [
319       "src/db/write_batch_test.cc",
320     ]
321     configs -= [ "//build/config/compiler:chromium_code" ]
322     configs += [ "//build/config/compiler:no_chromium_code" ]
323     deps = [
324       ":leveldb_testutil",
325     ]
326   }