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")
12 defines = [ "LEVELDB_PLATFORM_CHROMIUM=1" ]
14 config("leveldatabase_config") {
22 static_library("leveldatabase") {
27 "port/port_chromium.cc",
28 "port/port_chromium.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",
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",
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",
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",
86 "src/table/iterator.cc",
87 "src/table/iterator_wrapper.h",
88 "src/table/merger.cc",
91 "src/table/table_builder.cc",
92 "src/table/two_level_iterator.cc",
93 "src/table/two_level_iterator.h",
100 "src/util/comparator.cc",
101 "src/util/crc32c.cc",
104 "src/util/filter_policy.cc",
107 "src/util/logging.cc",
108 "src/util/logging.h",
109 "src/util/mutexlock.h",
110 "src/util/options.cc",
112 "src/util/status.cc",
115 configs -= [ "//build/config/compiler:chromium_code" ]
116 configs += [ "//build/config/compiler:no_chromium_code" ]
118 public_configs = [ ":leveldatabase_config" ]
122 "//base/third_party/dynamic_annotations",
127 defines += [ "USE_SNAPPY=1" ]
128 deps += [ "//third_party/snappy" ]
133 test("env_chromium_unittests") {
135 "env_chromium_unittest.cc",
139 "//base/test:test_support",
144 static_library("leveldb_testutil") {
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",
154 configs -= [ "//build/config/compiler:chromium_code" ]
155 configs += [ "//build/config/compiler:no_chromium_code" ]
165 test("leveldb_arena_test") {
167 "src/util/arena_test.cc",
169 configs -= [ "//build/config/compiler:chromium_code" ]
170 configs += [ "//build/config/compiler:no_chromium_code" ]
176 test("leveldb_bloom_test") {
178 "src/util/bloom_test.cc",
180 configs -= [ "//build/config/compiler:chromium_code" ]
181 configs += [ "//build/config/compiler:no_chromium_code" ]
187 test("leveldb_cache_test") {
189 "src/util/cache_test.cc",
191 configs -= [ "//build/config/compiler:chromium_code" ]
192 configs += [ "//build/config/compiler:no_chromium_code" ]
198 test("leveldb_corruption_test") {
200 "src/db/corruption_test.cc",
202 configs -= [ "//build/config/compiler:chromium_code" ]
203 configs += [ "//build/config/compiler:no_chromium_code" ]
209 test("leveldb_crc32c_test") {
211 "src/util/crc32c_test.cc",
213 configs -= [ "//build/config/compiler:chromium_code" ]
214 configs += [ "//build/config/compiler:no_chromium_code" ]
220 test("leveldb_db_bench") {
222 "src/db/db_bench.cc",
224 configs -= [ "//build/config/compiler:chromium_code" ]
225 configs += [ "//build/config/compiler:no_chromium_code" ]
231 test("leveldb_db_test") {
235 configs -= [ "//build/config/compiler:chromium_code" ]
236 configs += [ "//build/config/compiler:no_chromium_code" ]
242 test("leveldb_dbformat_test") {
244 "src/db/dbformat_test.cc",
246 configs -= [ "//build/config/compiler:chromium_code" ]
247 configs += [ "//build/config/compiler:no_chromium_code" ]
253 test("leveldb_env_test") {
255 "src/util/env_test.cc",
257 configs -= [ "//build/config/compiler:chromium_code" ]
258 configs += [ "//build/config/compiler:no_chromium_code" ]
264 test("leveldb_filename_test") {
266 "src/db/filename_test.cc",
268 configs -= [ "//build/config/compiler:chromium_code" ]
269 configs += [ "//build/config/compiler:no_chromium_code" ]
275 test("leveldb_filter_block_test") {
277 "src/table/filter_block_test.cc",
279 configs -= [ "//build/config/compiler:chromium_code" ]
280 configs += [ "//build/config/compiler:no_chromium_code" ]
286 test("leveldb_log_test") {
288 "src/db/log_test.cc",
290 configs -= [ "//build/config/compiler:chromium_code" ]
291 configs += [ "//build/config/compiler:no_chromium_code" ]
297 test("leveldb_skiplist_test") {
299 "src/db/skiplist_test.cc",
301 configs -= [ "//build/config/compiler:chromium_code" ]
302 configs += [ "//build/config/compiler:no_chromium_code" ]
308 test("leveldb_table_test") {
310 "src/table/table_test.cc",
312 configs -= [ "//build/config/compiler:chromium_code" ]
313 configs += [ "//build/config/compiler:no_chromium_code" ]
319 test("leveldb_version_edit_test") {
321 "src/db/version_edit_test.cc",
323 configs -= [ "//build/config/compiler:chromium_code" ]
324 configs += [ "//build/config/compiler:no_chromium_code" ]
330 test("leveldb_write_batch_test") {
332 "src/db/write_batch_test.cc",
334 configs -= [ "//build/config/compiler:chromium_code" ]
335 configs += [ "//build/config/compiler:no_chromium_code" ]