diff --git a/lib/BUCK b/lib/BUCK index 6812c1b1e..9e01468f4 100644 --- a/lib/BUCK +++ b/lib/BUCK @@ -15,15 +15,9 @@ cxx_library( header_namespace='', visibility=['PUBLIC'], exported_headers=subdir_glob([ - ('compress', 'zstdmt_compress.h'), + ('compress', 'zstd*.h'), ]), - headers=subdir_glob([ - ('compress', 'zstd_opt.h'), - ]), - srcs=[ - 'compress/zstd_compress.c', - 'compress/zstdmt_compress.c', - ], + srcs=glob(['compress/zstd*.c']), deps=[':common'], ) @@ -31,7 +25,7 @@ cxx_library( name='decompress', header_namespace='', visibility=['PUBLIC'], - srcs=['decompress/zstd_decompress.c'], + srcs=glob(['decompress/zstd*.c']), deps=[ ':common', ':legacy', @@ -58,6 +52,9 @@ cxx_library( ]), srcs=glob(['legacy/*.c']), deps=[':common'], + exported_preprocessor_flags=[ + '-DZSTD_LEGACY_SUPPORT=4', + ], ) cxx_library( @@ -74,6 +71,15 @@ cxx_library( deps=[':common'], ) +cxx_library( + name='compiler', + header_namespace='', + visibility=['PUBLIC'], + exported_headers=subdir_glob([ + ('common', 'compiler.h'), + ]), +) + cxx_library( name='bitstream', header_namespace='', @@ -100,6 +106,7 @@ cxx_library( ], deps=[ ':bitstream', + ':compiler', ':errors', ':mem', ], @@ -133,7 +140,10 @@ cxx_library( ('common', 'pool.h'), ]), srcs=['common/pool.c'], - deps=[':threading'], + deps=[ + ':threading', + ':zstd_common', + ], ) cxx_library( @@ -144,6 +154,12 @@ cxx_library( ('common', 'threading.h'), ]), srcs=['common/threading.c'], + exported_preprocessor_flags=[ + '-DZSTD_MULTITHREAD', + ], + exported_linker_flags=[ + '-pthread', + ], ) cxx_library( @@ -154,6 +170,9 @@ cxx_library( ('common', 'xxhash.h'), ]), srcs=['common/xxhash.c'], + exported_preprocessor_flags=[ + '-DXXH_NAMESPACE=ZSTD_', + ], ) cxx_library( @@ -166,6 +185,7 @@ cxx_library( ]), srcs=['common/zstd_common.c'], deps=[ + ':compiler', ':errors', ':mem', ], @@ -175,6 +195,7 @@ cxx_library( name='common', deps=[ ':bitstream', + ':compiler', ':entropy', ':errors', ':mem', diff --git a/programs/BUCK b/programs/BUCK index 069403042..d2aa6373f 100644 --- a/programs/BUCK +++ b/programs/BUCK @@ -10,38 +10,19 @@ cxx_binary( '//lib:mem', '//lib:xxhash', ], -) - -cxx_binary( - name='zstdmt', - 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_GZCOMPRESS', + '-DZSTD_GZDECOMPRESS', + '-DZSTD_LZMACOMPRESS', + '-DZSTD_LZMADECOMPRES', + '-DZSTD_LZ4COMPRESS', + '-DZSTD_LZ4DECOMPRES', ], - preprocessor_flags=['-DZSTD_MULTITHREAD'], - linker_flags=['-lpthread'], -) - -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', + linker_flags=[ + '-lz', + '-llzma', + '-llz4', ], - preprocessor_flags=['-DZSTD_GZDECOMPRESS'], - linker_flags=['-lz'], ) cxx_library( diff --git a/zlibWrapper/BUCK b/zlibWrapper/BUCK index a3b74ac3f..a0710e1cf 100644 --- a/zlibWrapper/BUCK +++ b/zlibWrapper/BUCK @@ -12,7 +12,7 @@ cxx_library( deps=[ '//lib:zstd', '//lib:zstd_common', - ] + ], ) cxx_binary(