]> xenbits.xensource.com Git - libvirt.git/commitdiff
meson: build vstorage only on linux
authorNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Tue, 19 Jan 2021 13:34:26 +0000 (16:34 +0300)
committerNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Tue, 19 Jan 2021 17:25:42 +0000 (20:25 +0300)
This should fix CI error:

    ../dist-unpack/libvirt-7.1.0/src/storage/storage_backend_vstorage.c:10:10: fatal error: 'mntent.h' file not found
    #include <mntent.h>
    ^~~~~~~~~~

on freebsd and mac.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
meson.build

index e3e7ff758f883bec9d52f40b72b7c66c6f5fb863..d8a63baac9324f084f19c8cc99199febb5040fa4 100644 (file)
@@ -1957,8 +1957,19 @@ if conf.has('WITH_LIBVIRTD')
   endif
 
   if not get_option('storage_vstorage').disabled()
-    use_storage = true
-    conf.set('WITH_STORAGE_VSTORAGE', 1)
+    vstorage_enable = true
+    if host_machine.system() != 'linux'
+      if get_option('storage_fs').enabled()
+        error('Vstorage is supported only on Linux')
+      else
+        vstorage_enable = false
+      endif
+    endif
+
+    if vstorage_enable
+      use_storage = true
+      conf.set('WITH_STORAGE_VSTORAGE', 1)
+    endif
   endif
 
   if not get_option('storage_zfs').disabled()