On Tue, Jun 01, 2021 at 10:37:55AM +0200, Andrea Bolognani wrote:
These checks look different than most similar ones for no
particular reason.
This commit is better viewed with 'git show -w'.
Drop this line as I don't agree that it's better. It obscures the fact
that the code "if something.found() ..." is moved inside the check.
Pavel
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
meson.build | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/meson.build b/meson.build
index 1a2503488a..1d9c878fd0 100644
--- a/meson.build
+++ b/meson.build
@@ -991,12 +991,12 @@ endif
libpcap_version = '1.5.0'
if not get_option('libpcap').disabled()
libpcap_dep = dependency('pcap', version: '>=' + libpcap_version,
required: get_option('libpcap'))
+ if libpcap_dep.found()
+ conf.set('WITH_LIBPCAP', 1)
+ endif
else
libpcap_dep = dependency('', required: false)
endif
-if libpcap_dep.found()
- conf.set('WITH_LIBPCAP', 1)
-endif
libssh_version = '0.7'
if get_option('driver_remote').enabled()
@@ -1139,19 +1139,19 @@ if not get_option('readline').disabled()
endif
endif
endif
+ if readline_dep.found()
+ # We need this to avoid compilation issues with modern compilers.
+ # See 9ea3424a178 for a more detailed explanation
+ readline_dep = declare_dependency(
+ compile_args: [ '-D_FUNCTION_DEF' ],
+ dependencies: [ readline_dep ],
+ )
+
+ conf.set('WITH_READLINE', 1)
+ endif
else
readline_dep = dependency('', required: false)
endif
-if readline_dep.found()
- # We need this to avoid compilation issues with modern compilers.
- # See 9ea3424a178 for a more detailed explanation
- readline_dep = declare_dependency(
- compile_args: [ '-D_FUNCTION_DEF' ],
- dependencies: [ readline_dep ],
- )
-
- conf.set('WITH_READLINE', 1)
-endif
if not get_option('sanlock').disabled()
sanlock_dep = dependency('libsanlock_client', required:
get_option('sanlock'))
@@ -1882,10 +1882,9 @@ if conf.has('WITH_LIBVIRTD')
if not get_option('storage_vstorage').disabled()
vstorage_enable = true
if host_machine.system() != 'linux'
+ vstorage_enable = false
if get_option('storage_vstorage').enabled()
error('Vstorage is supported only on Linux')
- else
- vstorage_enable = false
endif
endif
--
2.31.1