xref: /freebsd-13.1/sys/contrib/zstd/lib/BUCK (revision 0f743729)
10c16b537SWarner Loshcxx_library(
20c16b537SWarner Losh    name='zstd',
30c16b537SWarner Losh    header_namespace='',
40c16b537SWarner Losh    exported_headers=['zstd.h'],
50c16b537SWarner Losh    visibility=['PUBLIC'],
60c16b537SWarner Losh    deps=[
70c16b537SWarner Losh        ':common',
80c16b537SWarner Losh        ':compress',
90c16b537SWarner Losh        ':decompress',
100c16b537SWarner Losh        ':deprecated',
110c16b537SWarner Losh    ],
120c16b537SWarner Losh)
130c16b537SWarner Losh
140c16b537SWarner Loshcxx_library(
150c16b537SWarner Losh    name='compress',
160c16b537SWarner Losh    header_namespace='',
170c16b537SWarner Losh    visibility=['PUBLIC'],
18052d3c12SConrad Meyer    exported_headers=subdir_glob([
190c16b537SWarner Losh        ('compress', 'zstd*.h'),
20052d3c12SConrad Meyer    ]),
210c16b537SWarner Losh    srcs=glob(['compress/zstd*.c', 'compress/hist.c']),
220c16b537SWarner Losh    deps=[':common'],
230c16b537SWarner Losh)
240c16b537SWarner Losh
250c16b537SWarner Loshcxx_library(
260c16b537SWarner Losh    name='decompress',
270c16b537SWarner Losh    header_namespace='',
2819fcbaf1SConrad Meyer    visibility=['PUBLIC'],
2919fcbaf1SConrad Meyer    headers=subdir_glob([
3019fcbaf1SConrad Meyer        ('decompress', '*_impl.h'),
31052d3c12SConrad Meyer    ]),
320c16b537SWarner Losh    srcs=glob(['decompress/zstd*.c']),
330c16b537SWarner Losh    deps=[
340c16b537SWarner Losh        ':common',
350c16b537SWarner Losh        ':legacy',
360c16b537SWarner Losh    ],
370c16b537SWarner Losh)
380c16b537SWarner Losh
390c16b537SWarner Loshcxx_library(
400c16b537SWarner Losh    name='deprecated',
410c16b537SWarner Losh    header_namespace='',
420c16b537SWarner Losh    visibility=['PUBLIC'],
430c16b537SWarner Losh    exported_headers=subdir_glob([
440c16b537SWarner Losh        ('deprecated', '*.h'),
450c16b537SWarner Losh    ]),
460c16b537SWarner Losh    srcs=glob(['deprecated/*.c']),
470c16b537SWarner Losh    deps=[':common'],
480c16b537SWarner Losh)
490c16b537SWarner Losh
500c16b537SWarner Loshcxx_library(
510c16b537SWarner Losh    name='legacy',
520c16b537SWarner Losh    header_namespace='',
530c16b537SWarner Losh    visibility=['PUBLIC'],
540c16b537SWarner Losh    exported_headers=subdir_glob([
550c16b537SWarner Losh        ('legacy', '*.h'),
560c16b537SWarner Losh    ]),
570c16b537SWarner Losh    srcs=glob(['legacy/*.c']),
58052d3c12SConrad Meyer    deps=[':common'],
59052d3c12SConrad Meyer    exported_preprocessor_flags=[
60052d3c12SConrad Meyer        '-DZSTD_LEGACY_SUPPORT=4',
610c16b537SWarner Losh    ],
620c16b537SWarner Losh)
630c16b537SWarner Losh
640c16b537SWarner Loshcxx_library(
650c16b537SWarner Losh    name='zdict',
660c16b537SWarner Losh    header_namespace='',
670c16b537SWarner Losh    visibility=['PUBLIC'],
680c16b537SWarner Losh    exported_headers=subdir_glob([
690c16b537SWarner Losh        ('dictBuilder', 'zdict.h'),
700c16b537SWarner Losh    ]),
710c16b537SWarner Losh    headers=subdir_glob([
72*0f743729SConrad Meyer        ('dictBuilder', 'divsufsort.h'),
730c16b537SWarner Losh        ('dictBuilder', 'cover.h'),
740c16b537SWarner Losh    ]),
750c16b537SWarner Losh    srcs=glob(['dictBuilder/*.c']),
760c16b537SWarner Losh    deps=[':common'],
770c16b537SWarner Losh)
780c16b537SWarner Losh
79052d3c12SConrad Meyercxx_library(
80052d3c12SConrad Meyer    name='compiler',
81052d3c12SConrad Meyer    header_namespace='',
82052d3c12SConrad Meyer    visibility=['PUBLIC'],
83052d3c12SConrad Meyer    exported_headers=subdir_glob([
84052d3c12SConrad Meyer        ('common', 'compiler.h'),
85052d3c12SConrad Meyer    ]),
86052d3c12SConrad Meyer)
87052d3c12SConrad Meyer
8819fcbaf1SConrad Meyercxx_library(
8919fcbaf1SConrad Meyer    name='cpu',
9019fcbaf1SConrad Meyer    header_namespace='',
9119fcbaf1SConrad Meyer    visibility=['PUBLIC'],
9219fcbaf1SConrad Meyer    exported_headers=subdir_glob([
9319fcbaf1SConrad Meyer        ('common', 'cpu.h'),
9419fcbaf1SConrad Meyer    ]),
9519fcbaf1SConrad Meyer)
9619fcbaf1SConrad Meyer
970c16b537SWarner Loshcxx_library(
980c16b537SWarner Losh    name='bitstream',
990c16b537SWarner Losh    header_namespace='',
1000c16b537SWarner Losh    visibility=['PUBLIC'],
1010c16b537SWarner Losh    exported_headers=subdir_glob([
1020c16b537SWarner Losh        ('common', 'bitstream.h'),
1030c16b537SWarner Losh    ]),
1040c16b537SWarner Losh)
1050c16b537SWarner Losh
1060c16b537SWarner Loshcxx_library(
1070c16b537SWarner Losh    name='entropy',
1080c16b537SWarner Losh    header_namespace='',
1090c16b537SWarner Losh    visibility=['PUBLIC'],
1100c16b537SWarner Losh    exported_headers=subdir_glob([
1110c16b537SWarner Losh        ('common', 'fse.h'),
1120c16b537SWarner Losh        ('common', 'huf.h'),
1130c16b537SWarner Losh    ]),
1140c16b537SWarner Losh    srcs=[
1150c16b537SWarner Losh        'common/entropy_common.c',
1160c16b537SWarner Losh        'common/fse_decompress.c',
1170c16b537SWarner Losh        'compress/fse_compress.c',
1180c16b537SWarner Losh        'compress/huf_compress.c',
1190c16b537SWarner Losh        'decompress/huf_decompress.c',
1200c16b537SWarner Losh    ],
1210c16b537SWarner Losh    deps=[
122052d3c12SConrad Meyer        ':debug',
1230c16b537SWarner Losh        ':bitstream',
1240c16b537SWarner Losh        ':compiler',
1250c16b537SWarner Losh        ':errors',
1260c16b537SWarner Losh        ':mem',
1270c16b537SWarner Losh    ],
1280c16b537SWarner Losh)
1290c16b537SWarner Losh
1300c16b537SWarner Loshcxx_library(
1310c16b537SWarner Losh    name='errors',
1320c16b537SWarner Losh    header_namespace='',
1330c16b537SWarner Losh    visibility=['PUBLIC'],
1340c16b537SWarner Losh    exported_headers=subdir_glob([
1350c16b537SWarner Losh        ('common', 'error_private.h'),
1360c16b537SWarner Losh        ('common', 'zstd_errors.h'),
1370c16b537SWarner Losh    ]),
1380c16b537SWarner Losh    srcs=['common/error_private.c'],
1390c16b537SWarner Losh)
1400c16b537SWarner Losh
1410c16b537SWarner Loshcxx_library(
1420c16b537SWarner Losh    name='mem',
1430c16b537SWarner Losh    header_namespace='',
1440c16b537SWarner Losh    visibility=['PUBLIC'],
1450c16b537SWarner Losh    exported_headers=subdir_glob([
1460c16b537SWarner Losh        ('common', 'mem.h'),
1470c16b537SWarner Losh    ]),
1480c16b537SWarner Losh)
1490c16b537SWarner Losh
1500c16b537SWarner Loshcxx_library(
1510c16b537SWarner Losh    name='pool',
1520c16b537SWarner Losh    header_namespace='',
1530c16b537SWarner Losh    visibility=['PUBLIC'],
1540c16b537SWarner Losh    exported_headers=subdir_glob([
1550c16b537SWarner Losh        ('common', 'pool.h'),
156052d3c12SConrad Meyer    ]),
157052d3c12SConrad Meyer    srcs=['common/pool.c'],
158052d3c12SConrad Meyer    deps=[
159052d3c12SConrad Meyer        ':threading',
1600c16b537SWarner Losh        ':zstd_common',
1610c16b537SWarner Losh    ],
1620c16b537SWarner Losh)
1630c16b537SWarner Losh
1640c16b537SWarner Loshcxx_library(
1650c16b537SWarner Losh    name='threading',
1660c16b537SWarner Losh    header_namespace='',
1670c16b537SWarner Losh    visibility=['PUBLIC'],
1680c16b537SWarner Losh    exported_headers=subdir_glob([
1690c16b537SWarner Losh        ('common', 'threading.h'),
170052d3c12SConrad Meyer    ]),
171052d3c12SConrad Meyer    srcs=['common/threading.c'],
172052d3c12SConrad Meyer    exported_preprocessor_flags=[
173052d3c12SConrad Meyer        '-DZSTD_MULTITHREAD',
174052d3c12SConrad Meyer    ],
175052d3c12SConrad Meyer    exported_linker_flags=[
1760c16b537SWarner Losh        '-pthread',
1770c16b537SWarner Losh    ],
1780c16b537SWarner Losh)
1790c16b537SWarner Losh
1800c16b537SWarner Loshcxx_library(
1810c16b537SWarner Losh    name='xxhash',
1820c16b537SWarner Losh    header_namespace='',
1830c16b537SWarner Losh    visibility=['PUBLIC'],
1840c16b537SWarner Losh    exported_headers=subdir_glob([
1850c16b537SWarner Losh        ('common', 'xxhash.h'),
186052d3c12SConrad Meyer    ]),
187052d3c12SConrad Meyer    srcs=['common/xxhash.c'],
188052d3c12SConrad Meyer    exported_preprocessor_flags=[
1890c16b537SWarner Losh        '-DXXH_NAMESPACE=ZSTD_',
1900c16b537SWarner Losh    ],
1910c16b537SWarner Losh)
1920c16b537SWarner Losh
1930c16b537SWarner Loshcxx_library(
1940c16b537SWarner Losh    name='zstd_common',
1950c16b537SWarner Losh    header_namespace='',
1960c16b537SWarner Losh    visibility=['PUBLIC'],
1970c16b537SWarner Losh    exported_headers=subdir_glob([
1980c16b537SWarner Losh        ('', 'zstd.h'),
1990c16b537SWarner Losh        ('common', 'zstd_internal.h'),
2000c16b537SWarner Losh    ]),
201052d3c12SConrad Meyer    srcs=['common/zstd_common.c'],
2020c16b537SWarner Losh    deps=[
2030c16b537SWarner Losh        ':compiler',
2040c16b537SWarner Losh        ':errors',
2050c16b537SWarner Losh        ':mem',
2060c16b537SWarner Losh    ],
2070c16b537SWarner Losh)
2080c16b537SWarner Losh
2090c16b537SWarner Loshcxx_library(
2100c16b537SWarner Losh    name='debug',
211052d3c12SConrad Meyer    header_namespace='',
21219fcbaf1SConrad Meyer    visibility=['PUBLIC'],
2130c16b537SWarner Losh    exported_headers=subdir_glob([
2140c16b537SWarner Losh        ('common', 'debug.h'),
2150c16b537SWarner Losh    ]),
2160c16b537SWarner Losh    srcs=['common/debug.c'],
2170c16b537SWarner Losh)
2180c16b537SWarner Losh
2190c16b537SWarner Loshcxx_library(
2200c16b537SWarner Losh    name='common',
2210c16b537SWarner Losh    deps=[
222        ':debug',
223        ':bitstream',
224        ':compiler',
225        ':cpu',
226        ':entropy',
227        ':errors',
228        ':mem',
229        ':pool',
230        ':threading',
231        ':xxhash',
232        ':zstd_common',
233    ]
234)
235