]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Update BUCK files 902/head
authorNick Terrell <terrelln@fb.com>
Wed, 25 Oct 2017 19:47:57 +0000 (12:47 -0700)
committerNick Terrell <terrelln@fb.com>
Wed, 25 Oct 2017 19:47:57 +0000 (12:47 -0700)
* Correct XXH namespace (Fixes #901)
* Multithreading always enabled
* GZIP/LZ4/LZMA always enabled
* Legacy support always fully enabled

lib/BUCK
programs/BUCK
zlibWrapper/BUCK

index 6812c1b1e54c543184346fccb537ba0cd33af344..9e01468f4ddebfc208951dc968ead444166c9f6c 100644 (file)
--- 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',
index 0694030429932ccc1c3a55beb75f15b8505a2fa8..d2aa6373ff47e94962dd206ec2ba739d77e0bc0d 100644 (file)
@@ -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(
index a3b74ac3f9fa97c18ab09cffd28516a98faeeef1..a0710e1cf4cdeac9a83b0740675b4a2743cffdab 100644 (file)
@@ -12,7 +12,7 @@ cxx_library(
     deps=[
         '//lib:zstd',
         '//lib:zstd_common',
-    ]
+    ],
 )
 
 cxx_binary(