clients: avoid build error without gl-renderer
authorStefan Agner <stefan@agner.ch>
Sun, 20 Oct 2019 15:17:20 +0000 (17:17 +0200)
committerPekka Paalanen <pq@iki.fi>
Thu, 24 Oct 2019 09:09:33 +0000 (09:09 +0000)
Make sure gl-renderer is enabled when building the EGL and EGL
dmabuf clients. This avoids missing declaration warnings and
linking errors such as:
  ../clients/simple-dmabuf-egl.c:1142: undefined reference to `weston_check_egl_extension
  ...
  ../clients/simple-egl.c:206: undefined reference to `weston_check_egl_extension'

Signed-off-by: Stefan Agner <stefan@agner.ch>
clients/meson.build

index 93d94b1e319e815b8a9566a776203f8aead4c1ec..2ee44392eff656c9ee2d224f4b6d5be6040bf26e 100644 (file)
@@ -66,7 +66,8 @@ simple_clients = [
                        dep_libdrm,
                        dep_libm
                ],
-               'deps': [ 'egl', 'glesv2', 'gbm' ]
+               'deps': [ 'egl', 'glesv2', 'gbm' ],
+               'options': [ 'renderer-gl' ]
        },
        {
                'name': 'dmabuf-v4l',
@@ -91,7 +92,8 @@ simple_clients = [
                        ivi_application_protocol_c,
                ],
                'dep_objs': [ dep_wayland_client, dep_libshared, dep_libm ],
-               'deps': [ 'egl', 'wayland-egl', 'glesv2', 'wayland-cursor' ]
+               'deps': [ 'egl', 'wayland-egl', 'glesv2', 'wayland-cursor' ],
+               'options': [ 'renderer-gl' ]
        },
        # weston-simple-im is handled specially separately due to install_dir and odd window.h usage
        {
@@ -130,6 +132,12 @@ foreach t : simple_clients
                        t_deps += dep
                endforeach
 
+               foreach optname : t.get('options', [])
+                       if not get_option(optname)
+                               error('@0@ requires option @1@ which is not enabled. If you rather not build this, drop "@2@" from simple-clients option.'.format(t_name, optname, t.get('name')))
+                       endif
+               endforeach
+
                executable(
                        t_name, t.get('sources'),
                        include_directories: common_inc,