diff --git a/helpers/meson.build b/helpers/meson.build
index 8f54e62e14644cc4b43137ae5298e2028caeb785..06436e5b20d0acd2749f4bd025c879f552379c9e 100644
--- a/helpers/meson.build
+++ b/helpers/meson.build
@@ -80,45 +80,27 @@ executable(
   # and its associated drivers successfully.
 )
 
-custom_target(
-  'frag.spv',
-  build_by_default : true,
-  command : [
-    glslang_validator,
-    '--target-env', 'vulkan1.0',
-    '-o', '@OUTPUT@',
-    '@INPUT@',
-  ],
-  input : 'shader.frag',
-  output : 'frag.spv',
-  install : true,
-  install_dir : join_paths(
-    get_option('prefix'),
-    get_option('libexecdir'),
-    'steam-runtime-tools-' + api_major,
-    'shaders',
-  )
-)
-
-custom_target(
-  'vert.spv',
-  build_by_default : true,
-  command : [
-    glslang_validator,
-    '--target-env', 'vulkan1.0',
-    '-o', '@OUTPUT@',
-    '@INPUT@',
-  ],
-  input : 'shader.vert',
-  output : 'vert.spv',
-  install : true,
-  install_dir : join_paths(
-    get_option('prefix'),
-    get_option('libexecdir'),
-    'steam-runtime-tools-' + api_major,
-    'shaders',
+foreach shader : ['frag', 'vert']
+  custom_target(
+    shader + '.spv',
+    build_by_default : true,
+    command : [
+      glslang_validator,
+      '--target-env', 'vulkan1.0',
+      '-o', '@OUTPUT@',
+      '@INPUT@',
+    ],
+    input : 'shader.' + shader,
+    output : shader + '.spv',
+    install : true,
+    install_dir : join_paths(
+      get_option('prefix'),
+      get_option('libexecdir'),
+      'steam-runtime-tools-' + api_major,
+      'shaders',
+    )
   )
-)
+endforeach
 
 executable(
   multiarch + '-check-gl',