summaryrefslogtreecommitdiff
path: root/py/pyv4l2/meson.build
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2021-10-06 10:26:00 +0300
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2021-10-06 10:44:26 +0300
commit2b1a8f48f3a414e565cefb809f3e6a7c6aa5f8a7 (patch)
tree3f274b92d00754e6a5980f07b2c9cefcbf2cae53 /py/pyv4l2/meson.build
parentf691ed65d6bcfff0abbc2d7ce58e560af3ee63dc (diff)
Split V4L2 code into separate libs
Create v4l2++ library and pyv4l2, which are independent from the rest of the kms++. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Diffstat (limited to 'py/pyv4l2/meson.build')
-rw-r--r--py/pyv4l2/meson.build38
1 files changed, 38 insertions, 0 deletions
diff --git a/py/pyv4l2/meson.build b/py/pyv4l2/meson.build
new file mode 100644
index 0000000..03b0dcc
--- /dev/null
+++ b/py/pyv4l2/meson.build
@@ -0,0 +1,38 @@
+py3_dep = dependency('python3', required : get_option('pyv4l2'))
+
+if py3_dep.found() == false
+ subdir_done()
+endif
+
+pybind11_dep = dependency('pybind11', fallback : ['pybind11', 'pybind11_dep'],
+ required : get_option('pyv4l2'))
+
+if pybind11_dep.found() == false
+ subdir_done()
+endif
+
+pyv4l2_sources = files([
+ 'pyv4l2.cpp',
+])
+
+pyv4l2_deps = [
+ libv4l2xx_dep,
+ py3_dep,
+ pybind11_dep,
+]
+
+pyv4l2_args = [ '-fvisibility=hidden' ]
+
+destdir = get_option('libdir') / 'python' + py3_dep.version() / 'site-packages/pyv4l2'
+
+pyv4l2 = shared_module('pyv4l2',
+ pyv4l2_sources,
+ install : true,
+ install_dir : destdir,
+ name_prefix : '',
+ dependencies : pyv4l2_deps,
+ cpp_args : pyv4l2_args)
+
+# Copy __init__.py to build dir so that we can run without installing
+configure_file(input: '__init__.py', output: '__init__.py', copy: true,
+ install : true, install_dir : destdir)