Add enable_lz4 build option and fix lzma dependency

This commit is contained in:
Lzu Tao 2018-11-29 11:05:40 +07:00
parent 5c4965c351
commit c0e71cae55
3 changed files with 10 additions and 1 deletions

View 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

View 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')

View 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,