]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add enable_lz4 build option and fix lzma dependency
authorLzu Tao <taolzu@gmail.com>
Thu, 29 Nov 2018 04:05:40 +0000 (11:05 +0700)
committerLzu Tao <taolzu@gmail.com>
Sat, 1 Dec 2018 16:18:59 +0000 (23:18 +0700)
contrib/meson/meson.build
contrib/meson/meson_options.txt
contrib/meson/programs/meson.build

index a8df86b85df94406e18c5a019aa5d7f50e1230dc..966c5008e664f75bab6f09d138597fa658d2899f 100644 (file)
@@ -50,6 +50,7 @@ enable_contrib = get_option('build_contrib')
 enable_multithread = get_option('multithread_support')
 enable_zlib = get_option('zlib_support')
 enable_lzma = get_option('lzma_support')
+enable_lz4 = get_option('lz4_support')
 
 # =============================================================================
 # Helper scripts for Meson
@@ -78,7 +79,8 @@ endif
 libm_dep = cc.find_library('m', required: true)
 thread_dep = dependency('threads', required: false)
 zlib_dep = dependency('zlib', required: false)
-lzma_dep = dependency('lzma', required: false)
+lzma_dep = dependency('liblzma', required: false)
+lz4_dep = dependency('liblz4', required: false)
 
 # =============================================================================
 # Compiler flags
index 066be6a323a1021c3c585e788e22c16ba9608321..86a36523a68886ee2897dcc652a0c14959959b52 100644 (file)
@@ -24,3 +24,5 @@ option('zlib_support', type: 'boolean', value: false,
     description: 'Enable zlib support')
 option('lzma_support', type: 'boolean', value: false,
     description: 'Enable lzma support')
+option('lz4_support', type: 'boolean', value: false,
+    description: 'Enable lz4 support')
index e9f1c518ddea0c5790ce64fe14f787b04563a7c4..c96b6d4584e022000d8fc84259504fd83c42c0ea 100644 (file)
@@ -38,6 +38,11 @@ if enable_lzma and lzma_dep.found()
     zstd_c_args += [ '-DZSTD_LZMACOMPRESS', '-DZSTD_LZMADECOMPRESS' ]
 endif
 
+if enable_lz4 and lz4_dep.found()
+    zstd_deps += [ lz4_dep ]
+    zstd_c_args += [ '-DZSTD_LZ4COMPRESS', '-DZSTD_LZ4DECOMPRESS' ]
+endif
+
 zstd = executable('zstd',
     zstd_programs_sources,
     c_args: zstd_c_args,