[libcamera-devel] [PATCH] meson: detect kernel version

Stéphane Cerveau scerveau at collabora.com
Thu Jun 11 11:33:50 CEST 2020


Add kernel version detection to warn user
that only >= 5.0.0 V4L API are supported in
libcamera.

Signed-off-by: Stéphane Cerveau <scerveau at collabora.com>
---
 meson.build | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/meson.build b/meson.build
index e898782..5ac9039 100644
--- a/meson.build
+++ b/meson.build
@@ -105,6 +105,15 @@ if get_option('test')
     subdir('test')
 endif
 
+if not meson.is_cross_build()
+  kernel_version_req = '>= 6.0.0'
+  kernel_version = run_command('uname', '-r').stdout()
+  if not kernel_version.version_compare(kernel_version_req)
+    warning('Consider upgrading your kernel, as only @0@ is supported by libcamera at runtime'
+            .format(kernel_version_req))
+  endif
+endif
+
 # Create a symlink from the build root to the source root. This is used when
 # running libcamera from the build directory to locate resources in the source
 # directory (such as IPA configuration files).
-- 
2.17.1



More information about the libcamera-devel mailing list