Skip to content

Commit

Permalink
meson: Try wayland-scanner first without pkg-config
Browse files Browse the repository at this point in the history
Try finding the wayland-scanner program first without involving picking
its path from the pkg-config dependency. This way it is possible to
instruct Meson to override the the path where to find it using the
[binaries] section of a native file during cross-compilation.
  • Loading branch information
aperezdc committed May 5, 2021
1 parent 6e28e3d commit 39e1b45
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,14 @@ add_project_arguments(
language: ['c', 'cpp']
)

wayland_scanner_candidates = ['wayland-scanner']
wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true)
if wayland_scanner_dep.found()
wayland_scanner = find_program(
wayland_scanner_dep.get_pkgconfig_variable('wayland_scanner'),
native: true
)
else
wayland_scanner = find_program('wayland-scanner', native: true)
wayland_scanner_candidates += wayland_scanner_dep.get_pkgconfig_variable('wayland_scanner')
endif

wayland_scanner = find_program(wayland_scanner_candidates, native: true)

r = run_command(wayland_scanner, '--version')
assert(r.returncode() == 0,
'''Cannot execute wayland-scanner:
Expand Down

0 comments on commit 39e1b45

Please sign in to comment.