Skip to content

Commit

Permalink
build: Use Xwayland pkg-config if available (#682)
Browse files Browse the repository at this point in the history
  • Loading branch information
leigh123linux authored Feb 12, 2024
1 parent 38919a8 commit 80b48e9
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,15 @@ endif

have_xwayland_initfd = false
if have_wayland
xwayland_dep = dependency('xwayland', required: false)

xwayland_path = get_option('xwayland_path')
if xwayland_path == ''
xwayland_path = find_program('Xwayland').path()
if xwayland_dep.found()
xwayland_path = xwayland_dep.get_pkgconfig_variable('xwayland')
else
xwayland_path = find_program('Xwayland').path()
endif
endif
cdata.set_quoted('XWAYLAND_PATH', xwayland_path)

Expand All @@ -398,9 +404,15 @@ if have_wayland

# For Xwayland -initfd usage
use_initfd = get_option('xwayland_initfd')
if xwayland_dep.found()
xwayland_supports_initfd = xwayland_dep.get_pkgconfig_variable('have_initfd') == 'true'
else
xwayland_options = run_command(xwayland_path, '-help')
xwayland_supports_initfd = xwayland_options.stderr().contains('-initfd')
endif

if use_initfd.auto()
xwayland_options = run_command([xwayland_path, '-help'], check: true)
have_xwayland_initfd = xwayland_options.stderr().contains('-initfd')
have_xwayland_initfd = xwayland_supports_initfd
else
have_xwayland_initfd = use_initfd.enabled()
endif
Expand Down

0 comments on commit 80b48e9

Please sign in to comment.