小组成员:姚凯文(kevinyao0901),姜嘉琪

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