summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2020-09-05 10:54:18 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2020-09-14 11:40:34 +0300
commitccd3eb09b482d8a872b270436535c6c20ee4363f (patch)
tree0923d585f537cfac899133e7e27fc3cfbabbc8d2
parent5a920540b12253b1ebd7e658df19f916e3c55135 (diff)
Add meson build
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--.gitignore1
-rw-r--r--kms++/meson.build87
-rw-r--r--kms++util/meson.build43
-rw-r--r--kmscube/meson.build24
-rw-r--r--meson.build42
-rw-r--r--meson_options.txt3
-rw-r--r--py/meson.build1
-rw-r--r--py/pykms/meson.build38
-rw-r--r--utils/meson.build17
9 files changed, 256 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 7efae50..d198eef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ build
*.txt.user
*.patch
py/__pycache__
+meson.build.user
diff --git a/kms++/meson.build b/kms++/meson.build
new file mode 100644
index 0000000..fee1b54
--- /dev/null
+++ b/kms++/meson.build
@@ -0,0 +1,87 @@
+libkmsxx_sources = files([
+ 'src/atomicreq.cpp',
+ 'src/blob.cpp',
+ 'src/card.cpp',
+ 'src/connector.cpp',
+ 'src/crtc.cpp',
+ 'src/dmabufframebuffer.cpp',
+ 'src/drmobject.cpp',
+ 'src/drmpropobject.cpp',
+ 'src/dumbframebuffer.cpp',
+ 'src/encoder.cpp',
+ 'src/extframebuffer.cpp',
+ 'src/framebuffer.cpp',
+ 'src/helpers.cpp',
+ 'src/mode_cvt.cpp',
+ 'src/modedb_cea.cpp',
+ 'src/modedb.cpp',
+ 'src/modedb_dmt.cpp',
+ 'src/pixelformats.cpp',
+ 'src/plane.cpp',
+ 'src/property.cpp',
+ 'src/videomode.cpp',
+])
+
+public_headers = [
+ 'inc/kms++/dmabufframebuffer.h',
+ 'inc/kms++/atomicreq.h',
+ 'inc/kms++/property.h',
+ 'inc/kms++/plane.h',
+ 'inc/kms++/kms++.h',
+ 'inc/kms++/connector.h',
+ 'inc/kms++/card.h',
+ 'inc/kms++/modedb.h',
+ 'inc/kms++/pagefliphandler.h',
+ 'inc/kms++/encoder.h',
+ 'inc/kms++/decls.h',
+ 'inc/kms++/videomode.h',
+ 'inc/kms++/drmobject.h',
+ 'inc/kms++/pixelformats.h',
+ 'inc/kms++/crtc.h',
+ 'inc/kms++/framebuffer.h',
+ 'inc/kms++/extframebuffer.h',
+ 'inc/kms++/pipeline.h',
+ 'inc/kms++/drmpropobject.h',
+ 'inc/kms++/mode_cvt.h',
+ 'inc/kms++/blob.h',
+ 'inc/kms++/dumbframebuffer.h',
+]
+
+public_headers_omap = [
+ 'inc/kms++/omap/omapframebuffer.h',
+ 'inc/kms++/omap/omapkms++.h',
+ 'inc/kms++/omap/omapcard.h',
+]
+
+private_includes = include_directories('src', 'inc')
+public_includes = include_directories('inc')
+
+libdrm_dep = dependency('libdrm')
+
+if libdrmomap_dep.found()
+ libkmsxx_sources += files([
+ 'src/omap/omapcard.cpp',
+ 'src/omap/omapframebuffer.cpp',
+ ])
+endif
+
+libkmsxx_deps = [ libdrm_dep, libfmt_dep, libdrmomap_dep ]
+
+libkmsxx = library('kms++',
+ libkmsxx_sources,
+ install : true,
+ include_directories : private_includes,
+ dependencies : libkmsxx_deps)
+
+
+libkmsxx_dep = declare_dependency(include_directories : public_includes,
+ link_with : libkmsxx)
+
+install_headers(public_headers, subdir : 'kms++')
+
+if libdrmomap_dep.found()
+ install_headers(public_headers_omap, subdir : 'kms++/omap')
+endif
+
+pkg = import('pkgconfig')
+pkg.generate(libkmsxx)
diff --git a/kms++util/meson.build b/kms++util/meson.build
new file mode 100644
index 0000000..f9e76ae
--- /dev/null
+++ b/kms++util/meson.build
@@ -0,0 +1,43 @@
+libkmsxxutil_sources = files([
+ 'src/colorbar.cpp',
+ 'src/color.cpp',
+ 'src/cpuframebuffer.cpp',
+ 'src/drawing.cpp',
+ 'src/extcpuframebuffer.cpp',
+ 'src/opts.cpp',
+ 'src/resourcemanager.cpp',
+ 'src/strhelpers.cpp',
+ 'src/testpat.cpp',
+ 'src/videodevice.cpp',
+])
+
+public_headers = [
+ 'inc/kms++util/color.h',
+ 'inc/kms++util/kms++util.h',
+ 'inc/kms++util/stopwatch.h',
+ 'inc/kms++util/cpuframebuffer.h',
+ 'inc/kms++util/strhelpers.h',
+ 'inc/kms++util/opts.h',
+ 'inc/kms++util/extcpuframebuffer.h',
+ 'inc/kms++util/resourcemanager.h',
+ 'inc/kms++util/videodevice.h',
+]
+
+private_includes = include_directories('src', 'inc')
+public_includes = include_directories('inc')
+
+libkmsxxutil_deps = [ libkmsxx_dep, libfmt_dep ]
+
+libkmsxxutil = library('kms++util',
+ libkmsxxutil_sources,
+ install : true,
+ include_directories : private_includes,
+ dependencies : libkmsxxutil_deps)
+
+libkmsxxutil_dep = declare_dependency(include_directories : public_includes,
+ link_with : libkmsxxutil)
+
+install_headers(public_headers, subdir : 'kms++util')
+
+pkg = import('pkgconfig')
+pkg.generate(libkmsxxutil)
diff --git a/kmscube/meson.build b/kmscube/meson.build
new file mode 100644
index 0000000..68765f2
--- /dev/null
+++ b/kmscube/meson.build
@@ -0,0 +1,24 @@
+kmscube_sources = files([
+ 'cube.cpp',
+ 'cube-egl.cpp',
+ 'cube-gbm.cpp',
+ 'cube-gles2.cpp',
+ 'cube-null.cpp',
+ 'cube-wl.cpp',
+ 'cube-x11.cpp',
+ 'esTransform.cpp',
+])
+
+kmscube_deps = [
+ libdrm_dep, libkmsxx_dep, libkmsxxutil_dep, libfmt_dep,
+ dependency('x11'),
+ dependency('xcb'),
+ dependency('x11-xcb'),
+ dependency('gbm'),
+ dependency('wayland-client'),
+ dependency('wayland-egl'),
+ dependency('glesv2'),
+ dependency('egl'),
+]
+
+executable('kmscube', kmscube_sources, dependencies : kmscube_deps)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..bc5b8bf
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,42 @@
+project('kms++', 'cpp',
+ default_options : [
+ 'cpp_std=c++17',
+ ],
+)
+
+cpp = meson.get_compiler('cpp')
+cpp_arguments = []
+
+if (cpp.get_id() == 'gcc' and
+ host_machine.cpu_family() == 'arm' and
+ cpp.has_argument('-Wno-psabi'))
+ cpp_arguments += [
+ '-Wno-psabi',
+ ]
+endif
+
+if cpp.has_argument('-Wno-c99-designator')
+ cpp_arguments += [
+ '-Wno-c99-designator',
+ ]
+endif
+
+add_project_arguments(cpp_arguments, language : 'cpp')
+
+libfmt_includes = include_directories('ext/fmt/include')
+libfmt_dep = declare_dependency(include_directories : libfmt_includes,
+ compile_args : '-DFMT_HEADER_ONLY')
+
+pybind11_includes = include_directories('ext/pybind11/include')
+pybind11_dep = declare_dependency(include_directories : pybind11_includes)
+
+libdrmomap_dep = dependency('libdrm_omap', required : get_option('omap'))
+
+subdir('kms++')
+subdir('kms++util')
+subdir('utils')
+subdir('py')
+
+if get_option('kmscube')
+ subdir('kmscube')
+endif
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..037d41c
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,3 @@
+option('kmscube', type : 'boolean', value : false)
+option('pykms', type : 'feature', value : 'auto')
+option('omap', type : 'feature', value : 'auto')
diff --git a/py/meson.build b/py/meson.build
new file mode 100644
index 0000000..3130bf2
--- /dev/null
+++ b/py/meson.build
@@ -0,0 +1 @@
+subdir('pykms')
diff --git a/py/pykms/meson.build b/py/pykms/meson.build
new file mode 100644
index 0000000..c0860d3
--- /dev/null
+++ b/py/pykms/meson.build
@@ -0,0 +1,38 @@
+py3_dep = dependency('python3', required : get_option('pykms'))
+
+if py3_dep.found() == false
+ subdir_done()
+endif
+
+pykms_sources = files([
+ 'pykmsbase.cpp',
+ 'pykms.cpp',
+ 'pykmsutil.cpp',
+ 'pyvid.cpp',
+])
+
+if libdrmomap_dep.found()
+ pykms_sources += files([
+ 'pykmsomap.cpp',
+ ])
+endif
+
+pykms_deps = [
+ libkmsxx_dep,
+ libkmsxxutil_dep,
+ py3_dep,
+ pybind11_dep,
+]
+
+destdir = get_option('libdir') / 'python' + py3_dep.version() / 'site-packages/pykms'
+
+pykms = shared_module('pykms',
+ pykms_sources,
+ install : true,
+ install_dir : destdir,
+ name_prefix : '',
+ dependencies : pykms_deps)
+
+# 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)
diff --git a/utils/meson.build b/utils/meson.build
new file mode 100644
index 0000000..10f49f2
--- /dev/null
+++ b/utils/meson.build
@@ -0,0 +1,17 @@
+common_deps = [ libkmsxx_dep, libkmsxxutil_dep, libfmt_dep ]
+
+libevdev_dep = dependency('libevdev', required : false)
+
+executable('kmstest', 'kmstest.cpp', dependencies : [ common_deps ], install : true)
+executable('kmsview', 'kmsview.cpp', dependencies : [ common_deps ], install : false)
+executable('kmsprint', 'kmsprint.cpp', dependencies : [ common_deps ], install : true)
+executable('fbtest', 'fbtest.cpp', dependencies : [ common_deps ], install : true)
+executable('kmscapture', 'kmscapture.cpp', dependencies : [ common_deps ], install : false)
+executable('kmsblank', 'kmsblank.cpp', dependencies : [ common_deps ], install : true)
+
+if libevdev_dep.found()
+ executable('kmstouch', 'kmstouch.cpp', dependencies : [ common_deps, libevdev_dep ], install : false)
+endif
+
+executable('wbcap', 'wbcap.cpp', dependencies : [ common_deps ], install : false)
+executable('wbm2m', 'wbm2m.cpp', dependencies : [ common_deps ], install : false)