]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: Style tweaks
authorAndrea Bolognani <abologna@redhat.com>
Wed, 26 May 2021 15:47:58 +0000 (17:47 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 1 Jun 2021 12:32:02 +0000 (14:32 +0200)
These checks look different than most similar ones for no
particular reason.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
meson.build

index 36bb35541444b3cb8fc42bf50a7d4e5d3563b6be..2fa379f47ab7666b9399d0d42c5d6d8cf85e69fa 100644 (file)
@@ -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