From 62cc368047df4226fbdc436af6ba8ade6707008f Mon Sep 17 00:00:00 2001 From: yangyingchao Date: Wed, 19 Jul 2023 07:31:23 +0800 Subject: [PATCH] meson: make fractional scale optional. --- INSTALL.md | 1 + meson.build | 12 +++++++----- meson_options.txt | 3 +++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 9e2da8ec..99eead68 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -155,6 +155,7 @@ Available compile-time options: | `-Dsystemd-units-dir` | string | `${systemduserunitdir}` | Where to install the systemd service files (absolute) | None | | `-Dutmp-backend` | combo | `auto` | Which utmp backend to use (`none`, `libutempter`, `ulog` or `auto`) | libutempter or ulog | | `-Dutmp-default-helper-path` | string | `auto` | Default path to utmp helper binary. `auto` selects path based on `utmp-backend` | None | +| `-Dfractional-scale` | bool | `true` | Enable fractional scale support (available after >=wayland-protocol-1.31) | None | Documentation includes the man pages, readme, changelog and license files. diff --git a/meson.build b/meson.build index 1a00153c..498943b3 100644 --- a/meson.build +++ b/meson.build @@ -161,14 +161,16 @@ if wayland_protocols.version().version_compare('>=1.21') else xdg_activation = false endif -if wayland_protocols.version().version_compare('>=1.31') - add_project_arguments('-DHAVE_FRACTIONAL_SCALE', language: 'c') - wl_proto_xml += [wayland_protocols_datadir + '/stable/viewporter/viewporter.xml'] - wl_proto_xml += [wayland_protocols_datadir + '/staging/fractional-scale/fractional-scale-v1.xml'] - fractional_scale = true + +if get_option('fractional-scale') and wayland_protocols.version().version_compare('>=1.31') + add_project_arguments('-DHAVE_FRACTIONAL_SCALE', language: 'c') + wl_proto_xml += [wayland_protocols_datadir + '/stable/viewporter/viewporter.xml'] + wl_proto_xml += [wayland_protocols_datadir + '/staging/fractional-scale/fractional-scale-v1.xml'] + fractional_scale = false else fractional_scale = false endif + if wayland_protocols.version().version_compare('>=1.32') wl_proto_xml += [ wayland_protocols_datadir + '/unstable/tablet/tablet-unstable-v2.xml', # required by cursor-shape-v1 diff --git a/meson_options.txt b/meson_options.txt index d16e23ae..bb039367 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -26,3 +26,6 @@ option('utmp-backend', type: 'combo', value: 'auto', choices: ['none', 'libutemp description: 'Which utmp logging backend to use. This affects how (with what arguments) the utmp helper binary (see \'utmp-default-helper-path\')is called. Default: auto (linux=libutempter, freebsd=ulog, others=none)') option('utmp-default-helper-path', type: 'string', value: 'auto', description: 'Default path to the utmp helper binary. Default: auto-detect') + +option('fractional-scale', type: 'boolean', value: true, + description: 'Enables fractional scale support (available after wayland-protocol-1.31)')