xref: /freebsd/sys/contrib/zstd/lib/BUCK (revision 052d3c129019c2f03488f7cb7399580091f9a713)
10c16b537SWarner Loshcxx_library(
20c16b537SWarner Losh    name='zstd',
30c16b537SWarner Losh    header_namespace='',
40c16b537SWarner Losh    visibility=['PUBLIC'],
50c16b537SWarner Losh    deps=[
60c16b537SWarner Losh        ':common',
70c16b537SWarner Losh        ':compress',
80c16b537SWarner Losh        ':decompress',
90c16b537SWarner Losh        ':deprecated',
100c16b537SWarner Losh    ],
110c16b537SWarner Losh)
120c16b537SWarner Losh
130c16b537SWarner Loshcxx_library(
140c16b537SWarner Losh    name='compress',
150c16b537SWarner Losh    header_namespace='',
160c16b537SWarner Losh    visibility=['PUBLIC'],
170c16b537SWarner Losh    exported_headers=subdir_glob([
18*052d3c12SConrad Meyer        ('compress', 'zstd*.h'),
190c16b537SWarner Losh    ]),
20*052d3c12SConrad Meyer    srcs=glob(['compress/zstd*.c']),
210c16b537SWarner Losh    deps=[':common'],
220c16b537SWarner Losh)
230c16b537SWarner Losh
240c16b537SWarner Loshcxx_library(
250c16b537SWarner Losh    name='decompress',
260c16b537SWarner Losh    header_namespace='',
270c16b537SWarner Losh    visibility=['PUBLIC'],
28*052d3c12SConrad Meyer    srcs=glob(['decompress/zstd*.c']),
290c16b537SWarner Losh    deps=[
300c16b537SWarner Losh        ':common',
310c16b537SWarner Losh        ':legacy',
320c16b537SWarner Losh    ],
330c16b537SWarner Losh)
340c16b537SWarner Losh
350c16b537SWarner Loshcxx_library(
360c16b537SWarner Losh    name='deprecated',
370c16b537SWarner Losh    header_namespace='',
380c16b537SWarner Losh    visibility=['PUBLIC'],
390c16b537SWarner Losh    exported_headers=subdir_glob([
400c16b537SWarner Losh        ('decprecated', '*.h'),
410c16b537SWarner Losh    ]),
420c16b537SWarner Losh    srcs=glob(['deprecated/*.c']),
430c16b537SWarner Losh    deps=[':common'],
440c16b537SWarner Losh)
450c16b537SWarner Losh
460c16b537SWarner Loshcxx_library(
470c16b537SWarner Losh    name='legacy',
480c16b537SWarner Losh    header_namespace='',
490c16b537SWarner Losh    visibility=['PUBLIC'],
500c16b537SWarner Losh    exported_headers=subdir_glob([
510c16b537SWarner Losh        ('legacy', '*.h'),
520c16b537SWarner Losh    ]),
530c16b537SWarner Losh    srcs=glob(['legacy/*.c']),
540c16b537SWarner Losh    deps=[':common'],
55*052d3c12SConrad Meyer    exported_preprocessor_flags=[
56*052d3c12SConrad Meyer        '-DZSTD_LEGACY_SUPPORT=4',
57*052d3c12SConrad Meyer    ],
580c16b537SWarner Losh)
590c16b537SWarner Losh
600c16b537SWarner Loshcxx_library(
610c16b537SWarner Losh    name='zdict',
620c16b537SWarner Losh    header_namespace='',
630c16b537SWarner Losh    visibility=['PUBLIC'],
640c16b537SWarner Losh    exported_headers=subdir_glob([
650c16b537SWarner Losh        ('dictBuilder', 'zdict.h'),
660c16b537SWarner Losh    ]),
670c16b537SWarner Losh    headers=subdir_glob([
680c16b537SWarner Losh        ('dictBuilder', 'divsufsort.h'),
690c16b537SWarner Losh    ]),
700c16b537SWarner Losh    srcs=glob(['dictBuilder/*.c']),
710c16b537SWarner Losh    deps=[':common'],
720c16b537SWarner Losh)
730c16b537SWarner Losh
740c16b537SWarner Loshcxx_library(
75*052d3c12SConrad Meyer    name='compiler',
76*052d3c12SConrad Meyer    header_namespace='',
77*052d3c12SConrad Meyer    visibility=['PUBLIC'],
78*052d3c12SConrad Meyer    exported_headers=subdir_glob([
79*052d3c12SConrad Meyer        ('common', 'compiler.h'),
80*052d3c12SConrad Meyer    ]),
81*052d3c12SConrad Meyer)
82*052d3c12SConrad Meyer
83*052d3c12SConrad Meyercxx_library(
840c16b537SWarner Losh    name='bitstream',
850c16b537SWarner Losh    header_namespace='',
860c16b537SWarner Losh    visibility=['PUBLIC'],
870c16b537SWarner Losh    exported_headers=subdir_glob([
880c16b537SWarner Losh        ('common', 'bitstream.h'),
890c16b537SWarner Losh    ]),
900c16b537SWarner Losh)
910c16b537SWarner Losh
920c16b537SWarner Loshcxx_library(
930c16b537SWarner Losh    name='entropy',
940c16b537SWarner Losh    header_namespace='',
950c16b537SWarner Losh    visibility=['PUBLIC'],
960c16b537SWarner Losh    exported_headers=subdir_glob([
970c16b537SWarner Losh        ('common', 'fse.h'),
980c16b537SWarner Losh        ('common', 'huf.h'),
990c16b537SWarner Losh    ]),
1000c16b537SWarner Losh    srcs=[
1010c16b537SWarner Losh        'common/entropy_common.c',
1020c16b537SWarner Losh        'common/fse_decompress.c',
1030c16b537SWarner Losh        'compress/fse_compress.c',
1040c16b537SWarner Losh        'compress/huf_compress.c',
1050c16b537SWarner Losh        'decompress/huf_decompress.c',
1060c16b537SWarner Losh    ],
1070c16b537SWarner Losh    deps=[
1080c16b537SWarner Losh        ':bitstream',
109*052d3c12SConrad Meyer        ':compiler',
1100c16b537SWarner Losh        ':errors',
1110c16b537SWarner Losh        ':mem',
1120c16b537SWarner Losh    ],
1130c16b537SWarner Losh)
1140c16b537SWarner Losh
1150c16b537SWarner Loshcxx_library(
1160c16b537SWarner Losh    name='errors',
1170c16b537SWarner Losh    header_namespace='',
1180c16b537SWarner Losh    visibility=['PUBLIC'],
1190c16b537SWarner Losh    exported_headers=subdir_glob([
1200c16b537SWarner Losh        ('common', 'error_private.h'),
1210c16b537SWarner Losh        ('common', 'zstd_errors.h'),
1220c16b537SWarner Losh    ]),
1230c16b537SWarner Losh    srcs=['common/error_private.c'],
1240c16b537SWarner Losh)
1250c16b537SWarner Losh
1260c16b537SWarner Loshcxx_library(
1270c16b537SWarner Losh    name='mem',
1280c16b537SWarner Losh    header_namespace='',
1290c16b537SWarner Losh    visibility=['PUBLIC'],
1300c16b537SWarner Losh    exported_headers=subdir_glob([
1310c16b537SWarner Losh        ('common', 'mem.h'),
1320c16b537SWarner Losh    ]),
1330c16b537SWarner Losh)
1340c16b537SWarner Losh
1350c16b537SWarner Loshcxx_library(
1360c16b537SWarner Losh    name='pool',
1370c16b537SWarner Losh    header_namespace='',
1380c16b537SWarner Losh    visibility=['PUBLIC'],
1390c16b537SWarner Losh    exported_headers=subdir_glob([
1400c16b537SWarner Losh        ('common', 'pool.h'),
1410c16b537SWarner Losh    ]),
1420c16b537SWarner Losh    srcs=['common/pool.c'],
143*052d3c12SConrad Meyer    deps=[
144*052d3c12SConrad Meyer        ':threading',
145*052d3c12SConrad Meyer        ':zstd_common',
146*052d3c12SConrad Meyer    ],
1470c16b537SWarner Losh)
1480c16b537SWarner Losh
1490c16b537SWarner Loshcxx_library(
1500c16b537SWarner Losh    name='threading',
1510c16b537SWarner Losh    header_namespace='',
1520c16b537SWarner Losh    visibility=['PUBLIC'],
1530c16b537SWarner Losh    exported_headers=subdir_glob([
1540c16b537SWarner Losh        ('common', 'threading.h'),
1550c16b537SWarner Losh    ]),
1560c16b537SWarner Losh    srcs=['common/threading.c'],
157*052d3c12SConrad Meyer    exported_preprocessor_flags=[
158*052d3c12SConrad Meyer        '-DZSTD_MULTITHREAD',
159*052d3c12SConrad Meyer    ],
160*052d3c12SConrad Meyer    exported_linker_flags=[
161*052d3c12SConrad Meyer        '-pthread',
162*052d3c12SConrad Meyer    ],
1630c16b537SWarner Losh)
1640c16b537SWarner Losh
1650c16b537SWarner Loshcxx_library(
1660c16b537SWarner Losh    name='xxhash',
1670c16b537SWarner Losh    header_namespace='',
1680c16b537SWarner Losh    visibility=['PUBLIC'],
1690c16b537SWarner Losh    exported_headers=subdir_glob([
1700c16b537SWarner Losh        ('common', 'xxhash.h'),
1710c16b537SWarner Losh    ]),
1720c16b537SWarner Losh    srcs=['common/xxhash.c'],
173*052d3c12SConrad Meyer    exported_preprocessor_flags=[
174*052d3c12SConrad Meyer        '-DXXH_NAMESPACE=ZSTD_',
175*052d3c12SConrad Meyer    ],
1760c16b537SWarner Losh)
1770c16b537SWarner Losh
1780c16b537SWarner Loshcxx_library(
1790c16b537SWarner Losh    name='zstd_common',
1800c16b537SWarner Losh    header_namespace='',
1810c16b537SWarner Losh    visibility=['PUBLIC'],
1820c16b537SWarner Losh    exported_headers=subdir_glob([
1830c16b537SWarner Losh        ('', 'zstd.h'),
1840c16b537SWarner Losh        ('common', 'zstd_internal.h'),
1850c16b537SWarner Losh    ]),
1860c16b537SWarner Losh    srcs=['common/zstd_common.c'],
1870c16b537SWarner Losh    deps=[
188*052d3c12SConrad Meyer        ':compiler',
1890c16b537SWarner Losh        ':errors',
1900c16b537SWarner Losh        ':mem',
1910c16b537SWarner Losh    ],
1920c16b537SWarner Losh)
1930c16b537SWarner Losh
1940c16b537SWarner Loshcxx_library(
1950c16b537SWarner Losh    name='common',
1960c16b537SWarner Losh    deps=[
1970c16b537SWarner Losh        ':bitstream',
198*052d3c12SConrad Meyer        ':compiler',
1990c16b537SWarner Losh        ':entropy',
2000c16b537SWarner Losh        ':errors',
2010c16b537SWarner Losh        ':mem',
2020c16b537SWarner Losh        ':pool',
2030c16b537SWarner Losh        ':threading',
2040c16b537SWarner Losh        ':xxhash',
2050c16b537SWarner Losh        ':zstd_common',
2060c16b537SWarner Losh    ]
2070c16b537SWarner Losh)
208