xref: /freebsd-14.2/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=['zdict.h'],
690c16b537SWarner Losh    headers=subdir_glob([
700c16b537SWarner Losh        ('dictBuilder', 'divsufsort.h'),
710c16b537SWarner Losh        ('dictBuilder', 'cover.h'),
72*0f743729SConrad Meyer    ]),
730c16b537SWarner Losh    srcs=glob(['dictBuilder/*.c']),
740c16b537SWarner Losh    deps=[':common'],
750c16b537SWarner Losh)
760c16b537SWarner Losh
770c16b537SWarner Loshcxx_library(
780c16b537SWarner Losh    name='compiler',
79052d3c12SConrad Meyer    header_namespace='',
80052d3c12SConrad Meyer    visibility=['PUBLIC'],
81052d3c12SConrad Meyer    exported_headers=subdir_glob([
82052d3c12SConrad Meyer        ('common', 'compiler.h'),
83052d3c12SConrad Meyer    ]),
84052d3c12SConrad Meyer)
85052d3c12SConrad Meyer
86052d3c12SConrad Meyercxx_library(
87052d3c12SConrad Meyer    name='cpu',
8819fcbaf1SConrad Meyer    header_namespace='',
8919fcbaf1SConrad Meyer    visibility=['PUBLIC'],
9019fcbaf1SConrad Meyer    exported_headers=subdir_glob([
9119fcbaf1SConrad Meyer        ('common', 'cpu.h'),
9219fcbaf1SConrad Meyer    ]),
9319fcbaf1SConrad Meyer)
9419fcbaf1SConrad Meyer
9519fcbaf1SConrad Meyercxx_library(
9619fcbaf1SConrad Meyer    name='bitstream',
970c16b537SWarner Losh    header_namespace='',
980c16b537SWarner Losh    visibility=['PUBLIC'],
990c16b537SWarner Losh    exported_headers=subdir_glob([
1000c16b537SWarner Losh        ('common', 'bitstream.h'),
1010c16b537SWarner Losh    ]),
1020c16b537SWarner Losh)
1030c16b537SWarner Losh
1040c16b537SWarner Loshcxx_library(
1050c16b537SWarner Losh    name='entropy',
1060c16b537SWarner Losh    header_namespace='',
1070c16b537SWarner Losh    visibility=['PUBLIC'],
1080c16b537SWarner Losh    exported_headers=subdir_glob([
1090c16b537SWarner Losh        ('common', 'fse.h'),
1100c16b537SWarner Losh        ('common', 'huf.h'),
1110c16b537SWarner Losh    ]),
1120c16b537SWarner Losh    srcs=[
1130c16b537SWarner Losh        'common/entropy_common.c',
1140c16b537SWarner Losh        'common/fse_decompress.c',
1150c16b537SWarner Losh        'compress/fse_compress.c',
1160c16b537SWarner Losh        'compress/huf_compress.c',
1170c16b537SWarner Losh        'decompress/huf_decompress.c',
1180c16b537SWarner Losh    ],
1190c16b537SWarner Losh    deps=[
1200c16b537SWarner Losh        ':debug',
1210c16b537SWarner Losh        ':bitstream',
122052d3c12SConrad Meyer        ':compiler',
1230c16b537SWarner Losh        ':errors',
1240c16b537SWarner Losh        ':mem',
1250c16b537SWarner Losh    ],
1260c16b537SWarner Losh)
1270c16b537SWarner Losh
1280c16b537SWarner Loshcxx_library(
1290c16b537SWarner Losh    name='errors',
1300c16b537SWarner Losh    header_namespace='',
1310c16b537SWarner Losh    visibility=['PUBLIC'],
1320c16b537SWarner Losh    exported_headers=[
1330c16b537SWarner Losh        'zstd_errors.h',
1340c16b537SWarner Losh        'common/error_private.h',
1350c16b537SWarner Losh    ]
1360c16b537SWarner Losh    srcs=['common/error_private.c'],
1370c16b537SWarner Losh)
1380c16b537SWarner Losh
1390c16b537SWarner Loshcxx_library(
1400c16b537SWarner Losh    name='mem',
1410c16b537SWarner Losh    header_namespace='',
1420c16b537SWarner Losh    visibility=['PUBLIC'],
1430c16b537SWarner Losh    exported_headers=subdir_glob([
1440c16b537SWarner Losh        ('common', 'mem.h'),
1450c16b537SWarner Losh    ]),
1460c16b537SWarner Losh)
1470c16b537SWarner Losh
1480c16b537SWarner Loshcxx_library(
1490c16b537SWarner Losh    name='pool',
1500c16b537SWarner Losh    header_namespace='',
1510c16b537SWarner Losh    visibility=['PUBLIC'],
1520c16b537SWarner Losh    exported_headers=subdir_glob([
1530c16b537SWarner Losh        ('common', 'pool.h'),
1540c16b537SWarner Losh    ]),
1550c16b537SWarner Losh    srcs=['common/pool.c'],
156052d3c12SConrad Meyer    deps=[
157052d3c12SConrad Meyer        ':threading',
158052d3c12SConrad Meyer        ':zstd_common',
159052d3c12SConrad Meyer    ],
1600c16b537SWarner Losh)
1610c16b537SWarner Losh
1620c16b537SWarner Loshcxx_library(
1630c16b537SWarner Losh    name='threading',
1640c16b537SWarner Losh    header_namespace='',
1650c16b537SWarner Losh    visibility=['PUBLIC'],
1660c16b537SWarner Losh    exported_headers=subdir_glob([
1670c16b537SWarner Losh        ('common', 'threading.h'),
1680c16b537SWarner Losh    ]),
1690c16b537SWarner Losh    srcs=['common/threading.c'],
170052d3c12SConrad Meyer    exported_preprocessor_flags=[
171052d3c12SConrad Meyer        '-DZSTD_MULTITHREAD',
172052d3c12SConrad Meyer    ],
173052d3c12SConrad Meyer    exported_linker_flags=[
174052d3c12SConrad Meyer        '-pthread',
175052d3c12SConrad Meyer    ],
1760c16b537SWarner Losh)
1770c16b537SWarner Losh
1780c16b537SWarner Loshcxx_library(
1790c16b537SWarner Losh    name='xxhash',
1800c16b537SWarner Losh    header_namespace='',
1810c16b537SWarner Losh    visibility=['PUBLIC'],
1820c16b537SWarner Losh    exported_headers=subdir_glob([
1830c16b537SWarner Losh        ('common', 'xxhash.h'),
1840c16b537SWarner Losh    ]),
1850c16b537SWarner Losh    srcs=['common/xxhash.c'],
186052d3c12SConrad Meyer    exported_preprocessor_flags=[
187052d3c12SConrad Meyer        '-DXXH_NAMESPACE=ZSTD_',
188052d3c12SConrad Meyer    ],
1890c16b537SWarner Losh)
1900c16b537SWarner Losh
1910c16b537SWarner Loshcxx_library(
1920c16b537SWarner Losh    name='zstd_common',
1930c16b537SWarner Losh    header_namespace='',
1940c16b537SWarner Losh    visibility=['PUBLIC'],
1950c16b537SWarner Losh    exported_headers=subdir_glob([
1960c16b537SWarner Losh        ('', 'zstd.h'),
1970c16b537SWarner Losh        ('common', 'zstd_internal.h'),
1980c16b537SWarner Losh    ]),
1990c16b537SWarner Losh    srcs=['common/zstd_common.c'],
2000c16b537SWarner Losh    deps=[
201052d3c12SConrad Meyer        ':compiler',
2020c16b537SWarner Losh        ':errors',
2030c16b537SWarner Losh        ':mem',
2040c16b537SWarner Losh    ],
2050c16b537SWarner Losh)
2060c16b537SWarner Losh
2070c16b537SWarner Loshcxx_library(
2080c16b537SWarner Losh    name='debug',
2090c16b537SWarner Losh    header_namespace='',
2100c16b537SWarner Losh    visibility=['PUBLIC'],
211052d3c12SConrad Meyer    exported_headers=subdir_glob([
21219fcbaf1SConrad Meyer        ('common', 'debug.h'),
2130c16b537SWarner Losh    ]),
2140c16b537SWarner Losh    srcs=['common/debug.c'],
2150c16b537SWarner Losh)
2160c16b537SWarner Losh
2170c16b537SWarner Loshcxx_library(
2180c16b537SWarner Losh    name='common',
2190c16b537SWarner Losh    deps=[
2200c16b537SWarner Losh        ':debug',
2210c16b537SWarner Losh        ':bitstream',
222        ':compiler',
223        ':cpu',
224        ':entropy',
225        ':errors',
226        ':mem',
227        ':pool',
228        ':threading',
229        ':xxhash',
230        ':zstd_common',
231    ]
232)
233