Remove duplicated logic related to lz4 and meson

This commit is contained in:
pancake 2022-02-27 19:03:10 +01:00
parent f8c34ed122
commit 3a5e758a4c
2 changed files with 6 additions and 13 deletions

View File

@ -96,16 +96,9 @@ if get_option('sdb_cgen')
r_util_sources += r_util_d_sources
endif
r_util_deps = [ldl, mth, spp_dep, pth, utl, sdb_dep, zlib_dep, platform_deps]
if lz4_dep.found() and get_option('use_sys_lz4')
# r_util_deps += lz4_dep
r_util_deps += declare_dependency(
link_with: libr2lz4,
include_directories: lz4_inc
)
else
r_util_sources += '../../shlr/lz4/lz4.c'
endif
r_util_deps = [ldl, mth, spp_dep, pth, utl, sdb_dep, lz4_dep, zlib_dep, platform_deps]
if host_machine.system().startswith('freebsd') or host_machine.system().startswith('netbsd') or host_machine.system().startswith('haiku')
# backtrace_symbols_fd requires -lexecinfo
r_util_deps += [cc.find_library('execinfo')]

View File

@ -1,5 +1,7 @@
lz4_dep = dependency('liblz4', required: false)
if not lz4_dep.found() or not get_option('use_sys_lz4')
if lz4_dep.found() and get_option('use_sys_lz4')
message('Using system-provided lz4 library')
else
message('Using bundled lz4')
lz4_files = [
'lz4.c',
@ -16,6 +18,4 @@ if not lz4_dep.found() or not get_option('use_sys_lz4')
link_with: libr2lz4,
include_directories: lz4_inc
)
else
message('Using system-provided lz4 library')
endif