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.

315 line
7.2 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. 'table/block.cc',
  99. 'table/block.h',
  100. 'table/block_builder.cc',
  101. 'table/block_builder.h',
  102. 'table/format.cc',
  103. 'table/format.h',
  104. 'table/iterator.cc',
  105. 'table/iterator_wrapper.h',
  106. 'table/merger.cc',
  107. 'table/merger.h',
  108. 'table/table.cc',
  109. 'table/table_builder.cc',
  110. 'table/two_level_iterator.cc',
  111. 'table/two_level_iterator.h',
  112. 'util/arena.cc',
  113. 'util/arena.h',
  114. 'util/cache.cc',
  115. 'util/coding.cc',
  116. 'util/coding.h',
  117. 'util/comparator.cc',
  118. 'util/crc32c.cc',
  119. 'util/crc32c.h',
  120. 'util/env.cc',
  121. 'util/env_chromium.cc',
  122. 'util/env_posix.cc',
  123. 'util/hash.cc',
  124. 'util/hash.h',
  125. 'util/logging.cc',
  126. 'util/logging.h',
  127. 'util/mutexlock.h',
  128. 'util/options.cc',
  129. 'util/random.h',
  130. 'util/status.cc',
  131. ],
  132. 'sources/': [
  133. ['exclude', '_(android|example|portable|posix)\\.cc$'],
  134. ],
  135. },
  136. {
  137. 'target_name': 'leveldb_testutil',
  138. 'type': '<(library)',
  139. 'dependencies': [
  140. '../../base/base.gyp:base',
  141. 'leveldb',
  142. ],
  143. 'export_dependent_settings': [
  144. # The tests use include directories from these projects.
  145. '../../base/base.gyp:base',
  146. 'leveldb',
  147. ],
  148. 'sources': [
  149. 'util/histogram.cc',
  150. 'util/histogram.h',
  151. 'util/testharness.cc',
  152. 'util/testharness.h',
  153. 'util/testutil.cc',
  154. 'util/testutil.h',
  155. ],
  156. },
  157. {
  158. 'target_name': 'leveldb_arena_test',
  159. 'type': 'executable',
  160. 'dependencies': [
  161. 'leveldb_testutil',
  162. ],
  163. 'sources': [
  164. 'util/arena_test.cc',
  165. ],
  166. },
  167. {
  168. 'target_name': 'leveldb_cache_test',
  169. 'type': 'executable',
  170. 'dependencies': [
  171. 'leveldb_testutil',
  172. ],
  173. 'sources': [
  174. 'util/cache_test.cc',
  175. ],
  176. },
  177. {
  178. 'target_name': 'leveldb_coding_test',
  179. 'type': 'executable',
  180. 'dependencies': [
  181. 'leveldb_testutil',
  182. ],
  183. 'sources': [
  184. 'util/coding_test.cc',
  185. ],
  186. },
  187. {
  188. 'target_name': 'leveldb_corruption_test',
  189. 'type': 'executable',
  190. 'dependencies': [
  191. 'leveldb_testutil',
  192. ],
  193. 'sources': [
  194. 'db/corruption_test.cc',
  195. ],
  196. },
  197. {
  198. 'target_name': 'leveldb_crc32c_test',
  199. 'type': 'executable',
  200. 'dependencies': [
  201. 'leveldb_testutil',
  202. ],
  203. 'sources': [
  204. 'util/crc32c_test.cc',
  205. ],
  206. },
  207. {
  208. 'target_name': 'leveldb_db_bench',
  209. 'type': 'executable',
  210. 'dependencies': [
  211. 'leveldb_testutil',
  212. ],
  213. 'sources': [
  214. 'db/db_bench.cc',
  215. ],
  216. },
  217. {
  218. 'target_name': 'leveldb_db_test',
  219. 'type': 'executable',
  220. 'dependencies': [
  221. 'leveldb_testutil',
  222. ],
  223. 'sources': [
  224. 'db/db_test.cc',
  225. ],
  226. },
  227. {
  228. 'target_name': 'leveldb_dbformat_test',
  229. 'type': 'executable',
  230. 'dependencies': [
  231. 'leveldb_testutil',
  232. ],
  233. 'sources': [
  234. 'db/dbformat_test.cc',
  235. ],
  236. },
  237. {
  238. 'target_name': 'leveldb_env_test',
  239. 'type': 'executable',
  240. 'dependencies': [
  241. 'leveldb_testutil',
  242. ],
  243. 'sources': [
  244. 'util/env_test.cc',
  245. ],
  246. },
  247. {
  248. 'target_name': 'leveldb_filename_test',
  249. 'type': 'executable',
  250. 'dependencies': [
  251. 'leveldb_testutil',
  252. ],
  253. 'sources': [
  254. 'db/filename_test.cc',
  255. ],
  256. },
  257. {
  258. 'target_name': 'leveldb_log_test',
  259. 'type': 'executable',
  260. 'dependencies': [
  261. 'leveldb_testutil',
  262. ],
  263. 'sources': [
  264. 'db/log_test.cc',
  265. ],
  266. },
  267. {
  268. 'target_name': 'leveldb_skiplist_test',
  269. 'type': 'executable',
  270. 'dependencies': [
  271. 'leveldb_testutil',
  272. ],
  273. 'sources': [
  274. 'db/skiplist_test.cc',
  275. ],
  276. },
  277. {
  278. 'target_name': 'leveldb_table_test',
  279. 'type': 'executable',
  280. 'dependencies': [
  281. 'leveldb_testutil',
  282. ],
  283. 'sources': [
  284. 'table/table_test.cc',
  285. ],
  286. },
  287. {
  288. 'target_name': 'leveldb_version_edit_test',
  289. 'type': 'executable',
  290. 'dependencies': [
  291. 'leveldb_testutil',
  292. ],
  293. 'sources': [
  294. 'db/version_edit_test.cc',
  295. ],
  296. },
  297. {
  298. 'target_name': 'leveldb_write_batch_test',
  299. 'type': 'executable',
  300. 'dependencies': [
  301. 'leveldb_testutil',
  302. ],
  303. 'sources': [
  304. 'db/write_batch_test.cc',
  305. ],
  306. },
  307. ],
  308. }
  309. # Local Variables:
  310. # tab-width:2
  311. # indent-tabs-mode:nil
  312. # End:
  313. # vim: set expandtab tabstop=2 shiftwidth=2: