1 # Copyright (c) 2011 The LevelDB 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. See the AUTHORS file for names of contributors. 4 5 { 6 'variables': { 7 'use_snappy%': 1, 8 }, 9 'conditions': [ 10 ['OS == "android" and android_webview_build == 1', { 11 'variables': { 12 # Snappy not used in Android WebView 13 # crbug.com/236780 14 'use_snappy': 0, 15 }, 16 }], 17 ], 18 'target_defaults': { 19 'defines': [ 20 'LEVELDB_PLATFORM_CHROMIUM=1', 21 ], 22 'include_dirs': [ 23 '.', 24 'src/', 25 'src/include/', 26 ], 27 'conditions': [ 28 ['OS == "win"', { 29 'include_dirs': [ 30 'src/port/win', 31 ], 32 }], 33 ['use_snappy', { 34 'defines': [ 35 'USE_SNAPPY=1', 36 ], 37 }], 38 ], 39 }, 40 'targets': [ 41 { 42 'target_name': 'leveldatabase', 43 'type': 'static_library', 44 'dependencies': [ 45 '../../base/base.gyp:base', 46 # base::LazyInstance is a template that pulls in dynamic_annotations so 47 # we need to explictly link in the code for dynamic_annotations. 48 '../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', 49 '../re2/re2.gyp:re2', 50 ], 51 'conditions': [ 52 ['use_snappy', { 53 'dependencies': [ 54 '../../third_party/snappy/snappy.gyp:snappy', 55 ], 56 }], 57 ], 58 'direct_dependent_settings': { 59 'include_dirs': [ 60 'src/include/', 61 'src/', 62 '.', 63 ], 64 'conditions': [ 65 ['OS == "win"', { 66 'include_dirs': [ 67 'src/port/win', 68 ], 69 }], 70 ], 71 }, 72 # Patch posted for upstream, can be removed once that's landed and 73 # rolled into Chromium. 74 # Internal link: https://mondrian.corp.google.com/#review/29997992 75 'msvs_disabled_warnings': [ 76 # Signed/unsigned comparison. 77 4018, 78 79 # TODO(jschuh): http://crbug.com/167187 size_t -> int 80 4267, 81 ], 82 'sources': [ 83 # Include and then exclude so that all files show up in IDEs, even if 84 # they don't build. 85 'env_chromium.cc', 86 'env_chromium.h', 87 'env_idb.h', 88 'port/port_chromium.cc', 89 'port/port_chromium.h', 90 'src/db/builder.cc', 91 'src/db/builder.h', 92 'src/db/db_impl.cc', 93 'src/db/db_impl.h', 94 'src/db/db_iter.cc', 95 'src/db/db_iter.h', 96 'src/db/filename.cc', 97 'src/db/filename.h', 98 'src/db/dbformat.cc', 99 'src/db/dbformat.h', 100 'src/db/log_format.h', 101 'src/db/log_reader.cc', 102 'src/db/log_reader.h', 103 'src/db/log_writer.cc', 104 'src/db/log_writer.h', 105 'src/db/memtable.cc', 106 'src/db/memtable.h', 107 'src/db/repair.cc', 108 'src/db/skiplist.h', 109 'src/db/snapshot.h', 110 'src/db/table_cache.cc', 111 'src/db/table_cache.h', 112 'src/db/version_edit.cc', 113 'src/db/version_edit.h', 114 'src/db/version_set.cc', 115 'src/db/version_set.h', 116 'src/db/write_batch.cc', 117 'src/db/write_batch_internal.h', 118 'src/helpers/memenv/memenv.cc', 119 'src/helpers/memenv/memenv.h', 120 'src/include/leveldb/cache.h', 121 'src/include/leveldb/comparator.h', 122 'src/include/leveldb/db.h', 123 'src/include/leveldb/env.h', 124 'src/include/leveldb/filter_policy.h', 125 'src/include/leveldb/iterator.h', 126 'src/include/leveldb/options.h', 127 'src/include/leveldb/slice.h', 128 'src/include/leveldb/status.h', 129 'src/include/leveldb/table.h', 130 'src/include/leveldb/table_builder.h', 131 'src/include/leveldb/write_batch.h', 132 'src/port/port.h', 133 'src/port/port_example.h', 134 'src/port/port_posix.cc', 135 'src/port/port_posix.h', 136 'src/table/block.cc', 137 'src/table/block.h', 138 'src/table/block_builder.cc', 139 'src/table/block_builder.h', 140 'src/table/filter_block.cc', 141 'src/table/filter_block.h', 142 'src/table/format.cc', 143 'src/table/format.h', 144 'src/table/iterator.cc', 145 'src/table/iterator_wrapper.h', 146 'src/table/merger.cc', 147 'src/table/merger.h', 148 'src/table/table.cc', 149 'src/table/table_builder.cc', 150 'src/table/two_level_iterator.cc', 151 'src/table/two_level_iterator.h', 152 'src/util/arena.cc', 153 'src/util/arena.h', 154 'src/util/bloom.cc', 155 'src/util/cache.cc', 156 'src/util/coding.cc', 157 'src/util/coding.h', 158 'src/util/comparator.cc', 159 'src/util/crc32c.cc', 160 'src/util/crc32c.h', 161 'src/util/env.cc', 162 'src/util/filter_policy.cc', 163 'src/util/hash.cc', 164 'src/util/hash.h', 165 'src/util/logging.cc', 166 'src/util/logging.h', 167 'src/util/mutexlock.h', 168 'src/util/options.cc', 169 'src/util/random.h', 170 'src/util/status.cc', 171 ], 172 'sources/': [ 173 ['exclude', '_(android|example|portable|posix)\\.cc$'], 174 ], 175 }, 176 { 177 'target_name': 'env_chromium_unittests', 178 'type': '<(gtest_target_type)', 179 'dependencies': [ 180 'leveldatabase', 181 '../../base/base.gyp:test_support_base', 182 '../../testing/gtest.gyp:gtest', 183 ], 184 'sources': [ 185 'env_chromium_unittest.cc', 186 ], 187 }, 188 { 189 'target_name': 'leveldb_testutil', 190 'type': 'static_library', 191 'dependencies': [ 192 '../../base/base.gyp:base', 193 'leveldatabase', 194 ], 195 'export_dependent_settings': [ 196 # The tests use include directories from these projects. 197 '../../base/base.gyp:base', 198 'leveldatabase', 199 ], 200 'sources': [ 201 'src/util/histogram.cc', 202 'src/util/histogram.h', 203 'src/util/testharness.cc', 204 'src/util/testharness.h', 205 'src/util/testutil.cc', 206 'src/util/testutil.h', 207 ], 208 }, 209 { 210 'target_name': 'leveldb_arena_test', 211 'type': 'executable', 212 'dependencies': [ 213 'leveldb_testutil', 214 ], 215 'sources': [ 216 'src/util/arena_test.cc', 217 ], 218 }, 219 { 220 'target_name': 'leveldb_bloom_test', 221 'type': 'executable', 222 'dependencies': [ 223 'leveldb_testutil', 224 ], 225 'sources': [ 226 'src/util/bloom_test.cc', 227 ], 228 }, 229 { 230 'target_name': 'leveldb_cache_test', 231 'type': 'executable', 232 'dependencies': [ 233 'leveldb_testutil', 234 ], 235 'sources': [ 236 'src/util/cache_test.cc', 237 ], 238 }, 239 { 240 'target_name': 'leveldb_coding_test', 241 'type': 'executable', 242 'dependencies': [ 243 'leveldb_testutil', 244 ], 245 'sources': [ 246 'src/util/coding_test.cc', 247 ], 248 }, 249 { 250 'target_name': 'leveldb_corruption_test', 251 'type': 'executable', 252 'dependencies': [ 253 'leveldb_testutil', 254 ], 255 'sources': [ 256 'src/db/corruption_test.cc', 257 ], 258 }, 259 { 260 'target_name': 'leveldb_crc32c_test', 261 'type': 'executable', 262 'dependencies': [ 263 'leveldb_testutil', 264 ], 265 'sources': [ 266 'src/util/crc32c_test.cc', 267 ], 268 }, 269 { 270 'target_name': 'leveldb_db_bench', 271 'type': 'executable', 272 'dependencies': [ 273 'leveldb_testutil', 274 ], 275 'sources': [ 276 'src/db/db_bench.cc', 277 ], 278 }, 279 { 280 'target_name': 'leveldb_db_test', 281 'type': 'executable', 282 'dependencies': [ 283 'leveldb_testutil', 284 ], 285 'sources': [ 286 'src/db/db_test.cc', 287 ], 288 }, 289 { 290 'target_name': 'leveldb_dbformat_test', 291 'type': 'executable', 292 'dependencies': [ 293 'leveldb_testutil', 294 ], 295 'sources': [ 296 'src/db/dbformat_test.cc', 297 ], 298 }, 299 { 300 'target_name': 'leveldb_env_test', 301 'type': 'executable', 302 'dependencies': [ 303 'leveldb_testutil', 304 ], 305 'sources': [ 306 'src/util/env_test.cc', 307 ], 308 }, 309 { 310 'target_name': 'leveldb_filename_test', 311 'type': 'executable', 312 'dependencies': [ 313 'leveldb_testutil', 314 ], 315 'sources': [ 316 'src/db/filename_test.cc', 317 ], 318 }, 319 { 320 'target_name': 'leveldb_filter_block_test', 321 'type': 'executable', 322 'dependencies': [ 323 'leveldb_testutil', 324 ], 325 'sources': [ 326 'src/table/filter_block_test.cc', 327 ], 328 }, 329 { 330 'target_name': 'leveldb_log_test', 331 'type': 'executable', 332 'dependencies': [ 333 'leveldb_testutil', 334 ], 335 'sources': [ 336 'src/db/log_test.cc', 337 ], 338 }, 339 { 340 'target_name': 'leveldb_skiplist_test', 341 'type': 'executable', 342 'dependencies': [ 343 'leveldb_testutil', 344 ], 345 'sources': [ 346 'src/db/skiplist_test.cc', 347 ], 348 }, 349 { 350 'target_name': 'leveldb_table_test', 351 'type': 'executable', 352 'dependencies': [ 353 'leveldb_testutil', 354 ], 355 'sources': [ 356 'src/table/table_test.cc', 357 ], 358 }, 359 { 360 'target_name': 'leveldb_version_edit_test', 361 'type': 'executable', 362 'dependencies': [ 363 'leveldb_testutil', 364 ], 365 'sources': [ 366 'src/db/version_edit_test.cc', 367 ], 368 }, 369 { 370 'target_name': 'leveldb_write_batch_test', 371 'type': 'executable', 372 'dependencies': [ 373 'leveldb_testutil', 374 ], 375 'sources': [ 376 'src/db/write_batch_test.cc', 377 ], 378 }, 379 ], 380 } 381 382 # Local Variables: 383 # tab-width:2 384 # indent-tabs-mode:nil 385 # End: 386 # vim: set expandtab tabstop=2 shiftwidth=2: 387