summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorPhilipp Zabel <philipp.zabel@gmail.com>2022-12-05 17:28:23 +0100
committerPhilipp Zabel <p.zabel@pengutronix.de>2022-12-08 17:39:12 +0100
commit84c10124cdb71a913751d60040f3ae0802e28a8e (patch)
treed17f1bb81d4d7344a85be31df3d87a3ac465459c /meson.build
parent06eb28ba6282a34175bcd6e02c302416925386d1 (diff)
downloadweston-84c10124cdb71a913751d60040f3ae0802e28a8e.tar.gz
compositor: support loading backend via shortened name
While the --backend parameter looks like it takes a file name, it really is selected from a list of supported strings that are then funneled through a translation to enum weston_compositor_backend [1]. Because all backend parameters are of the form "...-backend.so", and writing "--backend=...-backend.so" is boring, allow the --backend option to match the backend name without "-backend.so" suffix instead. For example, this allows to use "--backend=headless" instead of "--backend=headless-backend.so". Update help text and documentation. Keep the old way working for backwards compatibility. [1] 50dbf385140b ("libweston: use enum to choose the backend") Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build3
1 files changed, 1 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index 237d1058..bf769cf4 100644
--- a/meson.build
+++ b/meson.build
@@ -124,8 +124,7 @@ if backend_default == 'auto'
endif
endforeach
endif
-opt_backend_native = backend_default + '-backend.so'
-config_h.set_quoted('WESTON_NATIVE_BACKEND', opt_backend_native)
+config_h.set_quoted('WESTON_NATIVE_BACKEND', backend_default)
message('The default backend is ' + backend_default)
if not get_option('backend-' + backend_default)
error('Backend @0@ was chosen as native but is not being built.'.format(backend_default))