diff --git a/gusb/meson.build b/gusb/meson.build
index 7c25d51..340bad9 100644
--- a/gusb/meson.build
+++ b/gusb/meson.build
@@ -169,14 +169,14 @@ pkgg.generate(
       ],
     )
 
-endif
 
 if get_option('vapi')
 gnome.generate_vapi('gusb',
   sources: libgusb_girtarget[0],
   packages: ['gio-2.0'],
   install: true,
 )
+endif
 endif
 
 if get_option('tests')
