+++ a/libportal/meson.build
@@ -26,14 +26,21 @@
   'wallpaper.h',
 ]
 
-portal_enums = gnome.mkenums('portal-enums',
-  sources: headers,
-  c_template: 'portal-enums.c.template',
-  h_template: 'portal-enums.h.template',
-  install_dir: join_paths (get_option('includedir'), 'libportal'),
-  install_header: true,
+portal_enums_c = custom_target('portal-enums.c',
+  input: ['portal-enums.c.template'],
+  output: 'portal-enums.c',
+  command: ['glib-mkenums', '--template=@INPUT@', '--output=@OUTPUT@', files(headers)]
 )
-generated_files += portal_enums
+
+portal_enums_h = custom_target('portal-enums.h',
+  input: ['portal-enums.h.template'],
+  output: 'portal-enums.h',
+  install: true,
+  install_dir: join_paths(get_option('includedir'), 'libportal'),
+  command: ['glib-mkenums', '--template=@INPUT@', '--output=@OUTPUT@', files(headers)]
+)
+
+generated_files = [portal_enums_c, portal_enums_h]
 
 src = [
   'account.c',
