BUCK 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. cxx_library(
  2. name='zstd',
  3. header_namespace='',
  4. visibility=['PUBLIC'],
  5. deps=[
  6. ':common',
  7. ':compress',
  8. ':decompress',
  9. ':deprecated',
  10. ],
  11. )
  12. cxx_library(
  13. name='compress',
  14. header_namespace='',
  15. visibility=['PUBLIC'],
  16. exported_headers=subdir_glob([
  17. ('compress', 'zstd*.h'),
  18. ]),
  19. srcs=glob(['compress/zstd*.c']),
  20. deps=[':common'],
  21. )
  22. cxx_library(
  23. name='decompress',
  24. header_namespace='',
  25. visibility=['PUBLIC'],
  26. headers=subdir_glob([
  27. ('decompress', '*_impl.h'),
  28. ]),
  29. srcs=glob(['decompress/zstd*.c']),
  30. deps=[
  31. ':common',
  32. ':legacy',
  33. ],
  34. )
  35. cxx_library(
  36. name='deprecated',
  37. header_namespace='',
  38. visibility=['PUBLIC'],
  39. exported_headers=subdir_glob([
  40. ('decprecated', '*.h'),
  41. ]),
  42. srcs=glob(['deprecated/*.c']),
  43. deps=[':common'],
  44. )
  45. cxx_library(
  46. name='legacy',
  47. header_namespace='',
  48. visibility=['PUBLIC'],
  49. exported_headers=subdir_glob([
  50. ('legacy', '*.h'),
  51. ]),
  52. srcs=glob(['legacy/*.c']),
  53. deps=[':common'],
  54. exported_preprocessor_flags=[
  55. '-DZSTD_LEGACY_SUPPORT=4',
  56. ],
  57. )
  58. cxx_library(
  59. name='zdict',
  60. header_namespace='',
  61. visibility=['PUBLIC'],
  62. exported_headers=subdir_glob([
  63. ('dictBuilder', 'zdict.h'),
  64. ]),
  65. headers=subdir_glob([
  66. ('dictBuilder', 'divsufsort.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. ':bitstream',
  112. ':compiler',
  113. ':errors',
  114. ':mem',
  115. ],
  116. )
  117. cxx_library(
  118. name='errors',
  119. header_namespace='',
  120. visibility=['PUBLIC'],
  121. exported_headers=subdir_glob([
  122. ('common', 'error_private.h'),
  123. ('common', 'zstd_errors.h'),
  124. ]),
  125. srcs=['common/error_private.c'],
  126. )
  127. cxx_library(
  128. name='mem',
  129. header_namespace='',
  130. visibility=['PUBLIC'],
  131. exported_headers=subdir_glob([
  132. ('common', 'mem.h'),
  133. ]),
  134. )
  135. cxx_library(
  136. name='pool',
  137. header_namespace='',
  138. visibility=['PUBLIC'],
  139. exported_headers=subdir_glob([
  140. ('common', 'pool.h'),
  141. ]),
  142. srcs=['common/pool.c'],
  143. deps=[
  144. ':threading',
  145. ':zstd_common',
  146. ],
  147. )
  148. cxx_library(
  149. name='threading',
  150. header_namespace='',
  151. visibility=['PUBLIC'],
  152. exported_headers=subdir_glob([
  153. ('common', 'threading.h'),
  154. ]),
  155. srcs=['common/threading.c'],
  156. exported_preprocessor_flags=[
  157. '-DZSTD_MULTITHREAD',
  158. ],
  159. exported_linker_flags=[
  160. '-pthread',
  161. ],
  162. )
  163. cxx_library(
  164. name='xxhash',
  165. header_namespace='',
  166. visibility=['PUBLIC'],
  167. exported_headers=subdir_glob([
  168. ('common', 'xxhash.h'),
  169. ]),
  170. srcs=['common/xxhash.c'],
  171. exported_preprocessor_flags=[
  172. '-DXXH_NAMESPACE=ZSTD_',
  173. ],
  174. )
  175. cxx_library(
  176. name='zstd_common',
  177. header_namespace='',
  178. visibility=['PUBLIC'],
  179. exported_headers=subdir_glob([
  180. ('', 'zstd.h'),
  181. ('common', 'zstd_internal.h'),
  182. ]),
  183. srcs=['common/zstd_common.c'],
  184. deps=[
  185. ':compiler',
  186. ':errors',
  187. ':mem',
  188. ],
  189. )
  190. cxx_library(
  191. name='common',
  192. deps=[
  193. ':bitstream',
  194. ':compiler',
  195. ':cpu',
  196. ':entropy',
  197. ':errors',
  198. ':mem',
  199. ':pool',
  200. ':threading',
  201. ':xxhash',
  202. ':zstd_common',
  203. ]
  204. )