diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build
index eb8845388692..5efae1baec8c 100644
--- a/src/py/libcamera/meson.build
+++ b/src/py/libcamera/meson.build
@@ -2,7 +2,7 @@
 
 py3_dep = dependency('python3', required : get_option('pycamera'))
 
-if not py3_dep.found()
+if get_option('pycamera').disabled() or not py3_dep.found()
     pycamera_enabled = false
     subdir_done()
 endif
