1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-30 22:23:13 +03:00

Update BUCK files

* Correct XXH namespace (Fixes #901)
* Multithreading always enabled
* GZIP/LZ4/LZMA always enabled
* Legacy support always fully enabled
This commit is contained in:
Nick Terrell
2017-10-25 12:47:57 -07:00
parent 97dccbbb2b
commit b495140f67
3 changed files with 43 additions and 41 deletions

View File

@ -15,15 +15,9 @@ cxx_library(
header_namespace='', header_namespace='',
visibility=['PUBLIC'], visibility=['PUBLIC'],
exported_headers=subdir_glob([ exported_headers=subdir_glob([
('compress', 'zstdmt_compress.h'), ('compress', 'zstd*.h'),
]), ]),
headers=subdir_glob([ srcs=glob(['compress/zstd*.c']),
('compress', 'zstd_opt.h'),
]),
srcs=[
'compress/zstd_compress.c',
'compress/zstdmt_compress.c',
],
deps=[':common'], deps=[':common'],
) )
@ -31,7 +25,7 @@ cxx_library(
name='decompress', name='decompress',
header_namespace='', header_namespace='',
visibility=['PUBLIC'], visibility=['PUBLIC'],
srcs=['decompress/zstd_decompress.c'], srcs=glob(['decompress/zstd*.c']),
deps=[ deps=[
':common', ':common',
':legacy', ':legacy',
@ -58,6 +52,9 @@ cxx_library(
]), ]),
srcs=glob(['legacy/*.c']), srcs=glob(['legacy/*.c']),
deps=[':common'], deps=[':common'],
exported_preprocessor_flags=[
'-DZSTD_LEGACY_SUPPORT=4',
],
) )
cxx_library( cxx_library(
@ -74,6 +71,15 @@ cxx_library(
deps=[':common'], deps=[':common'],
) )
cxx_library(
name='compiler',
header_namespace='',
visibility=['PUBLIC'],
exported_headers=subdir_glob([
('common', 'compiler.h'),
]),
)
cxx_library( cxx_library(
name='bitstream', name='bitstream',
header_namespace='', header_namespace='',
@ -100,6 +106,7 @@ cxx_library(
], ],
deps=[ deps=[
':bitstream', ':bitstream',
':compiler',
':errors', ':errors',
':mem', ':mem',
], ],
@ -133,7 +140,10 @@ cxx_library(
('common', 'pool.h'), ('common', 'pool.h'),
]), ]),
srcs=['common/pool.c'], srcs=['common/pool.c'],
deps=[':threading'], deps=[
':threading',
':zstd_common',
],
) )
cxx_library( cxx_library(
@ -144,6 +154,12 @@ cxx_library(
('common', 'threading.h'), ('common', 'threading.h'),
]), ]),
srcs=['common/threading.c'], srcs=['common/threading.c'],
exported_preprocessor_flags=[
'-DZSTD_MULTITHREAD',
],
exported_linker_flags=[
'-pthread',
],
) )
cxx_library( cxx_library(
@ -154,6 +170,9 @@ cxx_library(
('common', 'xxhash.h'), ('common', 'xxhash.h'),
]), ]),
srcs=['common/xxhash.c'], srcs=['common/xxhash.c'],
exported_preprocessor_flags=[
'-DXXH_NAMESPACE=ZSTD_',
],
) )
cxx_library( cxx_library(
@ -166,6 +185,7 @@ cxx_library(
]), ]),
srcs=['common/zstd_common.c'], srcs=['common/zstd_common.c'],
deps=[ deps=[
':compiler',
':errors', ':errors',
':mem', ':mem',
], ],
@ -175,6 +195,7 @@ cxx_library(
name='common', name='common',
deps=[ deps=[
':bitstream', ':bitstream',
':compiler',
':entropy', ':entropy',
':errors', ':errors',
':mem', ':mem',

View File

@ -10,38 +10,19 @@ cxx_binary(
'//lib:mem', '//lib:mem',
'//lib:xxhash', '//lib:xxhash',
], ],
) preprocessor_flags=[
'-DZSTD_GZCOMPRESS',
cxx_binary( '-DZSTD_GZDECOMPRESS',
name='zstdmt', '-DZSTD_LZMACOMPRESS',
headers=glob(['*.h'], excludes=['datagen.h', 'platform.h', 'util.h']), '-DZSTD_LZMADECOMPRES',
srcs=glob(['*.c'], excludes=['datagen.c']), '-DZSTD_LZ4COMPRESS',
deps=[ '-DZSTD_LZ4DECOMPRES',
':datagen',
':util',
'//lib:zstd',
'//lib:zdict',
'//lib:mem',
'//lib:xxhash',
], ],
preprocessor_flags=['-DZSTD_MULTITHREAD'], linker_flags=[
linker_flags=['-lpthread'], '-lz',
) '-llzma',
'-llz4',
cxx_binary(
name='gzstd',
headers=glob(['*.h'], excludes=['datagen.h', 'platform.h', 'util.h']),
srcs=glob(['*.c'], excludes=['datagen.c']),
deps=[
':datagen',
':util',
'//lib:zstd',
'//lib:zdict',
'//lib:mem',
'//lib:xxhash',
], ],
preprocessor_flags=['-DZSTD_GZDECOMPRESS'],
linker_flags=['-lz'],
) )
cxx_library( cxx_library(

View File

@ -12,7 +12,7 @@ cxx_library(
deps=[ deps=[
'//lib:zstd', '//lib:zstd',
'//lib:zstd_common', '//lib:zstd_common',
] ],
) )
cxx_binary( cxx_binary(