diff --git a/meson.build b/meson.build
index e86673dd5c0c..c35376e1e97b 100644
--- a/meson.build
+++ b/meson.build
@@ -164,38 +164,44 @@ liblttng = dependency('lttng-ust', required : get_option('tracing'))
 # are enabled.
 pipelines = get_option('pipelines')
 
+arch_arm = ['arm', 'aarch64']
+arch_x86 = ['x86', 'x86_64']
+pipes_support = {
+  'imx8-isi':     arch_arm,
+  'ipu3':         arch_x86,
+  'raspberrypi':  arch_arm,
+  'rkisp1':       arch_arm,
+  'simple':       arch_arm,
+  'uvcvideo':     ['any'],
+  'vimc':         ['test'],
+}
+
 if pipelines.contains('all')
-    pipelines = [
-        'imx8-isi',
-        'ipu3',
-        'raspberrypi',
-        'rkisp1',
-        'simple',
-        'uvcvideo',
-        'vimc',
-    ]
+    pipelines = []
+    foreach pipe, archs : pipes_support
+        pipelines += pipe
+    endforeach
 endif
 
 if pipelines.contains('auto')
     host_cpu = host_machine.cpu_family()
     pipelines = []
-    if host_cpu == 'x86' or host_cpu == 'x86_64'
-        pipelines += ['ipu3']
-    elif host_cpu == 'aarch64'
-        pipelines += ['imx8-isi', 'rkisp1']
-    endif
-
-    if host_cpu == 'arm' or host_cpu == 'aarch64'
-        pipelines += ['raspberrypi', 'simple']
-    endif
-
-    # Always include the uvcvideo pipeline handler.
-    pipelines += ['uvcvideo']
+    foreach pipe, archs : pipes_support
+        if host_cpu in archs or 'any' in archs
+            message('Auto-enabling ' + pipe + ' pipeline handler')
+            pipelines += pipe
+        endif
+    endforeach
 endif
 
-if get_option('test') and 'vimc' not in pipelines
-    message('Enabling vimc pipeline handler to support tests')
-    pipelines += ['vimc']
+if get_option('test')
+    foreach pipe, archs : pipes_support
+        if 'test' in archs and pipe not in pipelines
+            message('Enabling ' + pipe + ' pipeline handler for tests')
+            pipelines += pipe
+        endif
+    endforeach
 endif
 
 # Utilities are parsed first to provide support for other components.
-- 
2.34.1
