summaryrefslogtreecommitdiff
path: root/overlay
diff options
context:
space:
mode:
Diffstat (limited to 'overlay')
-rw-r--r--overlay/meson.build46
1 files changed, 36 insertions, 10 deletions
diff --git a/overlay/meson.build b/overlay/meson.build
index 546c8377..46d2d494 100644
--- a/overlay/meson.build
+++ b/overlay/meson.build
@@ -14,20 +14,35 @@ gpu_overlay_src = [
'rc6.c',
]
-xv = dependency('xv', required : false)
-x11 = dependency('x11', required : false)
-xext = dependency('xext', required : false)
-dri2proto = dependency('dri2proto', version : '>= 2.6', required : false)
-cairo_xlib = dependency('cairo-xlib', required : false)
-xrandr = dependency('xrandr', version : '>=1.3', required : false)
+xv_backend_required = false
+xlib_backend_required = false
+build_xv_backend = overlay_backends.contains('xv') or overlay_backends.contains('auto')
+build_xlib_backend = overlay_backends.contains('x') or overlay_backends.contains('auto')
+if _overlay_required
+ xv_backend_required = overlay_backends.contains('xv')
+ xlib_backend_required = overlay_backends.contains('x')
+endif
+
+xv = dependency('xv', required : xv_backend_required)
+x11 = dependency('x11', required : xv_backend_required)
+xext = dependency('xext', required : xv_backend_required)
+dri2proto = dependency('dri2proto',
+ version : '>= 2.6',
+ required : xv_backend_required or xlib_backend_required)
+cairo_xlib = dependency('cairo-xlib', required : xlib_backend_required)
+xrandr = dependency('xrandr', version : '>=1.3', required : _overlay_required)
gpu_overlay_deps = [ realtime, math, cairo, pciaccess, libdrm,
libdrm_intel, lib_igt_perf ]
both_x11_src = ''
+with_xv_backend = false
+with_xlib_backend = false
+backends_strings = []
+
gpu_overlay_cflags = []
-if xv.found() and x11.found() and xext.found() and dri2proto.found()
+if build_xv_backend and xv.found() and x11.found() and xext.found() and dri2proto.found()
both_x11_src = 'x11/position.c'
gpu_overlay_src += [
'x11/dri2.c',
@@ -38,20 +53,24 @@ if xv.found() and x11.found() and xext.found() and dri2proto.found()
]
gpu_overlay_deps += [ xv, x11, xext, dri2proto ]
gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XVLIB' ]
+ with_xv_backend = true
+ backends_strings += 'Xv'
endif
-if cairo_xlib.found() and xrandr.found() and dri2proto.found()
+if build_xlib_backend and cairo_xlib.found() and dri2proto.found()
both_x11_src = 'x11/position.c'
gpu_overlay_src += 'x11/x11-window.c'
gpu_overlay_deps += [ cairo_xlib, dri2proto ]
gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XLIB' ]
+ with_xlib_backend = true
+ backends_strings += 'X'
endif
gpu_overlay_src += both_x11_src
gpu_overlay_src += 'kms/kms-overlay.c'
-leg = find_program('leg', required : false)
+leg = find_program('leg', required : _overlay_required)
if leg.found()
leg_file = custom_target('tracepoint_format',
output: 'tracepoint_format.h',
@@ -62,10 +81,17 @@ else
message('WARNING: leg command not found, disabling overlay; try : apt-get install peg')
endif
-if leg.found() and xrandr.found() and cairo.found()
+if _build_overlay and ['x86', 'x86_64'].contains(host_machine.cpu_family()) and libdrm_intel.found() and leg.found() and xrandr.found() and cairo.found() and (with_xlib_backend or with_xv_backend)
executable('intel-gpu-overlay', gpu_overlay_src,
include_directories : inc,
c_args : gpu_overlay_cflags,
dependencies : gpu_overlay_deps,
install : true)
+ build_info += 'Build overlay: Yes'
+ build_info += 'Overlay backends: ' + ','.join(backends_strings)
+else
+ if _overlay_required
+ error('Cannot build overlay due to missing dependencies')
+ endif
+ build_info += 'Build overlay: No'
endif