diff --git a/src/meson.build b/src/meson.build
index 27f70544f1f6..8c7449f9b8a0 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -20,8 +20,5 @@ subdir('ipa')
 subdir('cam')
 subdir('qcam')
 
-if get_option('v4l2')
-    subdir('v4l2')
-endif
-
+subdir('v4l2')
 subdir('gstreamer')
diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build
index e3838f0b07cc..dbe6a424b10e 100644
--- a/src/v4l2/meson.build
+++ b/src/v4l2/meson.build
@@ -1,5 +1,9 @@
 # SPDX-License-Identifier: CC0-1.0
 
+if not get_option('v4l2')
+    subdir_done()
+endif
+
 v4l2_compat_sources = files([
     'v4l2_camera.cpp',
     'v4l2_camera_file.cpp',
