小组成员:姚凯文(kevinyao0901),姜嘉琪
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

327 lines
7.5 KiB

  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. 'variables': {
  6. 'use_snappy%': 0,
  7. },
  8. 'target_defaults': {
  9. 'defines': [
  10. 'LEVELDB_PLATFORM_CHROMIUM=1',
  11. ],
  12. 'include_dirs': [
  13. '.',
  14. 'include/',
  15. ],
  16. 'conditions': [
  17. ['OS == "win"', {
  18. 'include_dirs': [
  19. 'port/win',
  20. ],
  21. }],
  22. ['use_snappy', {
  23. 'defines': [
  24. 'USE_SNAPPY=1',
  25. ],
  26. }],
  27. ],
  28. },
  29. 'targets': [
  30. {
  31. 'target_name': 'leveldb',
  32. 'type': '<(library)',
  33. 'dependencies': [
  34. # The base libary is a lightweight abstraction layer for things like
  35. # threads and IO. http://src.chromium.org/viewvc/chrome/trunk/src/base/
  36. '../../base/base.gyp:base',
  37. ],
  38. 'conditions': [
  39. ['use_snappy', {
  40. 'dependencies': [
  41. '../../third_party/snappy/snappy.gyp:snappy',
  42. ],
  43. }],
  44. ],
  45. 'direct_dependent_settings': {
  46. 'include_dirs': [
  47. 'include/',
  48. ],
  49. },
  50. 'sources': [
  51. # Include and then exclude so that all files show up in IDEs, even if
  52. # they don't build.
  53. 'db/builder.cc',
  54. 'db/builder.h',
  55. 'db/db_impl.cc',
  56. 'db/db_impl.h',
  57. 'db/db_iter.cc',
  58. 'db/db_iter.h',
  59. 'db/filename.cc',
  60. 'db/filename.h',
  61. 'db/dbformat.cc',
  62. 'db/dbformat.h',
  63. 'db/log_format.h',
  64. 'db/log_reader.cc',
  65. 'db/log_reader.h',
  66. 'db/log_writer.cc',
  67. 'db/log_writer.h',
  68. 'db/memtable.cc',
  69. 'db/memtable.h',
  70. 'db/repair.cc',
  71. 'db/skiplist.h',
  72. 'db/snapshot.h',
  73. 'db/table_cache.cc',
  74. 'db/table_cache.h',
  75. 'db/version_edit.cc',
  76. 'db/version_edit.h',
  77. 'db/version_set.cc',
  78. 'db/version_set.h',
  79. 'db/write_batch.cc',
  80. 'db/write_batch_internal.h',
  81. 'include/leveldb/cache.h',
  82. 'include/leveldb/comparator.h',
  83. 'include/leveldb/db.h',
  84. 'include/leveldb/env.h',
  85. 'include/leveldb/iterator.h',
  86. 'include/leveldb/options.h',
  87. 'include/leveldb/slice.h',
  88. 'include/leveldb/status.h',
  89. 'include/leveldb/table.h',
  90. 'include/leveldb/table_builder.h',
  91. 'include/leveldb/write_batch.h',
  92. 'port/port.h',
  93. 'port/port_chromium.cc',
  94. 'port/port_chromium.h',
  95. 'port/port_example.h',
  96. 'port/port_posix.cc',
  97. 'port/port_posix.h',
  98. 'port/sha1_portable.cc',
  99. 'port/sha1_portable.h',
  100. 'table/block.cc',
  101. 'table/block.h',
  102. 'table/block_builder.cc',
  103. 'table/block_builder.h',
  104. 'table/format.cc',
  105. 'table/format.h',
  106. 'table/iterator.cc',
  107. 'table/iterator_wrapper.h',
  108. 'table/merger.cc',
  109. 'table/merger.h',
  110. 'table/table.cc',
  111. 'table/table_builder.cc',
  112. 'table/two_level_iterator.cc',
  113. 'table/two_level_iterator.h',
  114. 'util/arena.cc',
  115. 'util/arena.h',
  116. 'util/cache.cc',
  117. 'util/coding.cc',
  118. 'util/coding.h',
  119. 'util/comparator.cc',
  120. 'util/crc32c.cc',
  121. 'util/crc32c.h',
  122. 'util/env.cc',
  123. 'util/env_chromium.cc',
  124. 'util/env_posix.cc',
  125. 'util/hash.cc',
  126. 'util/hash.h',
  127. 'util/logging.cc',
  128. 'util/logging.h',
  129. 'util/mutexlock.h',
  130. 'util/options.cc',
  131. 'util/random.h',
  132. 'util/status.cc',
  133. ],
  134. 'sources/': [
  135. ['exclude', '_(android|example|portable|posix)\\.cc$'],
  136. ],
  137. },
  138. {
  139. 'target_name': 'leveldb_testutil',
  140. 'type': '<(library)',
  141. 'dependencies': [
  142. '../../base/base.gyp:base',
  143. 'leveldb',
  144. ],
  145. 'export_dependent_settings': [
  146. # The tests use include directories from these projects.
  147. '../../base/base.gyp:base',
  148. 'leveldb',
  149. ],
  150. 'sources': [
  151. 'util/histogram.cc',
  152. 'util/histogram.h',
  153. 'util/testharness.cc',
  154. 'util/testharness.h',
  155. 'util/testutil.cc',
  156. 'util/testutil.h',
  157. ],
  158. },
  159. {
  160. 'target_name': 'leveldb_arena_test',
  161. 'type': 'executable',
  162. 'dependencies': [
  163. 'leveldb_testutil',
  164. ],
  165. 'sources': [
  166. 'util/arena_test.cc',
  167. ],
  168. },
  169. {
  170. 'target_name': 'leveldb_cache_test',
  171. 'type': 'executable',
  172. 'dependencies': [
  173. 'leveldb_testutil',
  174. ],
  175. 'sources': [
  176. 'util/cache_test.cc',
  177. ],
  178. },
  179. {
  180. 'target_name': 'leveldb_coding_test',
  181. 'type': 'executable',
  182. 'dependencies': [
  183. 'leveldb_testutil',
  184. ],
  185. 'sources': [
  186. 'util/coding_test.cc',
  187. ],
  188. },
  189. {
  190. 'target_name': 'leveldb_corruption_test',
  191. 'type': 'executable',
  192. 'dependencies': [
  193. 'leveldb_testutil',
  194. ],
  195. 'sources': [
  196. 'db/corruption_test.cc',
  197. ],
  198. },
  199. {
  200. 'target_name': 'leveldb_crc32c_test',
  201. 'type': 'executable',
  202. 'dependencies': [
  203. 'leveldb_testutil',
  204. ],
  205. 'sources': [
  206. 'util/crc32c_test.cc',
  207. ],
  208. },
  209. {
  210. 'target_name': 'leveldb_db_bench',
  211. 'type': 'executable',
  212. 'dependencies': [
  213. 'leveldb_testutil',
  214. ],
  215. 'sources': [
  216. 'db/db_bench.cc',
  217. ],
  218. },
  219. {
  220. 'target_name': 'leveldb_db_test',
  221. 'type': 'executable',
  222. 'dependencies': [
  223. 'leveldb_testutil',
  224. ],
  225. 'sources': [
  226. 'db/db_test.cc',
  227. ],
  228. },
  229. {
  230. 'target_name': 'leveldb_dbformat_test',
  231. 'type': 'executable',
  232. 'dependencies': [
  233. 'leveldb_testutil',
  234. ],
  235. 'sources': [
  236. 'db/dbformat_test.cc',
  237. ],
  238. },
  239. {
  240. 'target_name': 'leveldb_env_test',
  241. 'type': 'executable',
  242. 'dependencies': [
  243. 'leveldb_testutil',
  244. ],
  245. 'sources': [
  246. 'util/env_test.cc',
  247. ],
  248. },
  249. {
  250. 'target_name': 'leveldb_filename_test',
  251. 'type': 'executable',
  252. 'dependencies': [
  253. 'leveldb_testutil',
  254. ],
  255. 'sources': [
  256. 'db/filename_test.cc',
  257. ],
  258. },
  259. {
  260. 'target_name': 'leveldb_log_test',
  261. 'type': 'executable',
  262. 'dependencies': [
  263. 'leveldb_testutil',
  264. ],
  265. 'sources': [
  266. 'db/log_test.cc',
  267. ],
  268. },
  269. {
  270. 'target_name': 'leveldb_sha1_test',
  271. 'type': 'executable',
  272. 'dependencies': [
  273. 'leveldb_testutil',
  274. ],
  275. 'sources': [
  276. 'port/sha1_test.cc',
  277. ],
  278. },
  279. {
  280. 'target_name': 'leveldb_skiplist_test',
  281. 'type': 'executable',
  282. 'dependencies': [
  283. 'leveldb_testutil',
  284. ],
  285. 'sources': [
  286. 'db/skiplist_test.cc',
  287. ],
  288. },
  289. {
  290. 'target_name': 'leveldb_table_test',
  291. 'type': 'executable',
  292. 'dependencies': [
  293. 'leveldb_testutil',
  294. ],
  295. 'sources': [
  296. 'table/table_test.cc',
  297. ],
  298. },
  299. {
  300. 'target_name': 'leveldb_version_edit_test',
  301. 'type': 'executable',
  302. 'dependencies': [
  303. 'leveldb_testutil',
  304. ],
  305. 'sources': [
  306. 'db/version_edit_test.cc',
  307. ],
  308. },
  309. {
  310. 'target_name': 'leveldb_write_batch_test',
  311. 'type': 'executable',
  312. 'dependencies': [
  313. 'leveldb_testutil',
  314. ],
  315. 'sources': [
  316. 'db/write_batch_test.cc',
  317. ],
  318. },
  319. ],
  320. }
  321. # Local Variables:
  322. # tab-width:2
  323. # indent-tabs-mode:nil
  324. # End:
  325. # vim: set expandtab tabstop=2 shiftwidth=2: