BUCK 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. cxx_library(
  2. name='zstd',
  3. header_namespace='',
  4. exported_headers=['zstd.h'],
  5. visibility=['PUBLIC'],
  6. deps=[
  7. ':common',
  8. ':compress',
  9. ':decompress',
  10. ':deprecated',
  11. ],
  12. )
  13. cxx_library(
  14. name='compress',
  15. header_namespace='',
  16. visibility=['PUBLIC'],
  17. exported_headers=subdir_glob([
  18. ('compress', 'zstd*.h'),
  19. ]),
  20. srcs=glob(['compress/zstd*.c', 'compress/hist.c']),
  21. deps=[':common'],
  22. )
  23. cxx_library(
  24. name='decompress',
  25. header_namespace='',
  26. visibility=['PUBLIC'],
  27. headers=subdir_glob([
  28. ('decompress', '*_impl.h'),
  29. ]),
  30. srcs=glob(['decompress/zstd*.c']),
  31. deps=[
  32. ':common',
  33. ':legacy',
  34. ],
  35. )
  36. cxx_library(
  37. name='deprecated',
  38. header_namespace='',
  39. visibility=['PUBLIC'],
  40. exported_headers=subdir_glob([
  41. ('deprecated', '*.h'),
  42. ]),
  43. srcs=glob(['deprecated/*.c']),
  44. deps=[':common'],
  45. )
  46. cxx_library(
  47. name='legacy',
  48. header_namespace='',
  49. visibility=['PUBLIC'],
  50. exported_headers=subdir_glob([
  51. ('legacy', '*.h'),
  52. ]),
  53. srcs=glob(['legacy/*.c']),
  54. deps=[':common'],
  55. exported_preprocessor_flags=[
  56. '-DZSTD_LEGACY_SUPPORT=4',
  57. ],
  58. )
  59. cxx_library(
  60. name='zdict',
  61. header_namespace='',
  62. visibility=['PUBLIC'],
  63. exported_headers=['zdict.h'],
  64. headers=subdir_glob([
  65. ('dictBuilder', 'divsufsort.h'),
  66. ('dictBuilder', 'cover.h'),
  67. ]),
  68. srcs=glob(['dictBuilder/*.c']),
  69. deps=[':common'],
  70. )
  71. cxx_library(
  72. name='compiler',
  73. header_namespace='',
  74. visibility=['PUBLIC'],
  75. exported_headers=subdir_glob([
  76. ('common', 'compiler.h'),
  77. ]),
  78. )
  79. cxx_library(
  80. name='cpu',
  81. header_namespace='',
  82. visibility=['PUBLIC'],
  83. exported_headers=subdir_glob([
  84. ('common', 'cpu.h'),
  85. ]),
  86. )
  87. cxx_library(
  88. name='bitstream',
  89. header_namespace='',
  90. visibility=['PUBLIC'],
  91. exported_headers=subdir_glob([
  92. ('common', 'bitstream.h'),
  93. ]),
  94. )
  95. cxx_library(
  96. name='entropy',
  97. header_namespace='',
  98. visibility=['PUBLIC'],
  99. exported_headers=subdir_glob([
  100. ('common', 'fse.h'),
  101. ('common', 'huf.h'),
  102. ]),
  103. srcs=[
  104. 'common/entropy_common.c',
  105. 'common/fse_decompress.c',
  106. 'compress/fse_compress.c',
  107. 'compress/huf_compress.c',
  108. 'decompress/huf_decompress.c',
  109. ],
  110. deps=[
  111. ':debug',
  112. ':bitstream',
  113. ':compiler',
  114. ':errors',
  115. ':mem',
  116. ],
  117. )
  118. cxx_library(
  119. name='errors',
  120. header_namespace='',
  121. visibility=['PUBLIC'],
  122. exported_headers=[
  123. 'zstd_errors.h',
  124. 'common/error_private.h',
  125. ]
  126. srcs=['common/error_private.c'],
  127. )
  128. cxx_library(
  129. name='mem',
  130. header_namespace='',
  131. visibility=['PUBLIC'],
  132. exported_headers=subdir_glob([
  133. ('common', 'mem.h'),
  134. ]),
  135. )
  136. cxx_library(
  137. name='pool',
  138. header_namespace='',
  139. visibility=['PUBLIC'],
  140. exported_headers=subdir_glob([
  141. ('common', 'pool.h'),
  142. ]),
  143. srcs=['common/pool.c'],
  144. deps=[
  145. ':threading',
  146. ':zstd_common',
  147. ],
  148. )
  149. cxx_library(
  150. name='threading',
  151. header_namespace='',
  152. visibility=['PUBLIC'],
  153. exported_headers=subdir_glob([
  154. ('common', 'threading.h'),
  155. ]),
  156. srcs=['common/threading.c'],
  157. exported_preprocessor_flags=[
  158. '-DZSTD_MULTITHREAD',
  159. ],
  160. exported_linker_flags=[
  161. '-pthread',
  162. ],
  163. )
  164. cxx_library(
  165. name='xxhash',
  166. header_namespace='',
  167. visibility=['PUBLIC'],
  168. exported_headers=subdir_glob([
  169. ('common', 'xxhash.h'),
  170. ]),
  171. srcs=['common/xxhash.c'],
  172. exported_preprocessor_flags=[
  173. '-DXXH_NAMESPACE=ZSTD_',
  174. ],
  175. )
  176. cxx_library(
  177. name='zstd_common',
  178. header_namespace='',
  179. visibility=['PUBLIC'],
  180. exported_headers=subdir_glob([
  181. ('', 'zstd.h'),
  182. ('common', 'zstd_internal.h'),
  183. ]),
  184. srcs=['common/zstd_common.c'],
  185. deps=[
  186. ':compiler',
  187. ':errors',
  188. ':mem',
  189. ],
  190. )
  191. cxx_library(
  192. name='debug',
  193. header_namespace='',
  194. visibility=['PUBLIC'],
  195. exported_headers=subdir_glob([
  196. ('common', 'debug.h'),
  197. ]),
  198. srcs=['common/debug.c'],
  199. )
  200. cxx_library(
  201. name='common',
  202. deps=[
  203. ':debug',
  204. ':bitstream',
  205. ':compiler',
  206. ':cpu',
  207. ':entropy',
  208. ':errors',
  209. ':mem',
  210. ':pool',
  211. ':threading',
  212. ':xxhash',
  213. ':zstd_common',
  214. ]
  215. )