[Mesa-dev] [PATCH kmscube 3/3] meson build support

Rob Clark robdclark at gmail.com
Sat Mar 25 20:11:46 UTC 2017


Figured I should figure out what this meson stuff is all about.  After a
bit of hunting around to find examples to look at (and interruptions) it
took maybe ~1hr to convert (for someone who never looked at meson
before).  The build speed is definitely faster even after Emil's auto-
tools improvements:

meson:
	real	0m1.310s
	user	0m2.069s
	sys	0m0.459s

autotools:
	real	0m4.489s
	user	0m3.754s
	sys	0m0.731s

(with gst / video-cube enabled, fresh build in either case so it is
including the time spent compiling .c files in both cases)

Signed-off-by: Rob Clark <robdclark at gmail.com>
---
 meson.build | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 meson.build

diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..08e14b6
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,44 @@
+project('kmscube', 'c')
+
+cc = meson.get_compiler('c')
+
+srcs = [
+	'common.c',
+	'common.h',
+	'cube-smooth.c',
+	'cube-tex.c',
+	'drm-atomic.c',
+	'drm-common.c',
+	'drm-common.h',
+	'drm-legacy.c',
+	'esTransform.c',
+	'esUtil.h',
+	'frame-512x512-NV12.c',
+	'frame-512x512-RGBA.c',
+	'kmscube.c'
+]
+
+deps = [
+	dependency('libdrm'),
+	dependency('gbm'),
+	dependency('egl'),
+	dependency('glesv2'),
+	cc.find_library('m')
+]
+
+gst = dependency('gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-app-1.0 gstreamer-allocators-1.0 gstreamer-video-1.0 glib-2.0')
+if gst.found()
+	message('Building video-cube')
+	deps = deps + [gst, cc.find_library('pthread')]
+	srcs = srcs + ['cube-video.c', 'gst-decoder.c']
+	add_global_arguments('-DHAVE_GST=1', language: 'c')
+endif
+
+add_global_arguments('-O0', language: 'c')
+add_global_arguments('-Wall', language: 'c')
+add_global_arguments('-Wextra', language: 'c')
+add_global_arguments('-std=c99', language: 'c')
+
+executable('kmscube', srcs,
+	dependencies: deps,
+	install: true)
-- 
2.9.3



More information about the mesa-dev mailing list