|
| 1 | +From 0e107f7bac8d84d8fb2bb5b83bfb4474348a82c1 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Romain Naour < [email protected]> |
| 3 | +Date: Wed, 17 Apr 2019 22:47:05 +0200 |
| 4 | +Subject: [PATCH] meson: use wayland-scanner provided by wayland-scanner-path |
| 5 | + |
| 6 | +When cross-compiling the .pc file might point to the wrong |
| 7 | +wayland-scanner binary (target rather than host) resulting in a |
| 8 | +non-executable and wrong scanner. |
| 9 | +First try by using the path provided by wayland-scanner-path, |
| 10 | +and if that fails fall back into pkg-config. |
| 11 | + |
| 12 | +Based on the patch for autotools provided by Gustavo Zacarias. |
| 13 | + |
| 14 | +Signed-off-by: Romain Naour < [email protected]> |
| 15 | +--- |
| 16 | + meson.build | 5 ++++- |
| 17 | + meson_options.txt | 6 ++++++ |
| 18 | + 2 files changed, 10 insertions(+), 1 deletion(-) |
| 19 | + |
| 20 | +diff --git a/meson.build b/meson.build |
| 21 | +index 6c4f1508855..ef0532b2cfb 100644 |
| 22 | +--- a/meson.build |
| 23 | ++++ b/meson.build |
| 24 | +@@ -1319,7 +1319,10 @@ endif |
| 25 | + |
| 26 | + if with_platform_wayland |
| 27 | + dep_wl_scanner = dependency('wayland-scanner', native: true) |
| 28 | +- prog_wl_scanner = find_program(dep_wl_scanner.get_pkgconfig_variable('wayland_scanner')) |
| 29 | ++ prog_wl_scanner = get_option('wayland-scanner-path') |
| 30 | ++ if prog_wl_scanner == '' |
| 31 | ++ prog_wl_scanner = find_program(dep_wl_scanner.get_pkgconfig_variable('wayland_scanner')) |
| 32 | ++ endif |
| 33 | + if dep_wl_scanner.version().version_compare('>= 1.15') |
| 34 | + wl_scanner_arg = 'private-code' |
| 35 | + else |
| 36 | +diff --git a/meson_options.txt b/meson_options.txt |
| 37 | +index ccf70659ff7..59ff8df8337 100644 |
| 38 | +--- a/meson_options.txt |
| 39 | ++++ b/meson_options.txt |
| 40 | +@@ -324,3 +324,9 @@ option( |
| 41 | + value : true, |
| 42 | + description : 'Enable direct rendering in GLX and EGL for DRI', |
| 43 | + ) |
| 44 | ++option( |
| 45 | ++ 'wayland-scanner-path', |
| 46 | ++ type : 'string', |
| 47 | ++ value : '', |
| 48 | ++ description : 'Locations to wayland-scanner binary. Default: use path from pkg-config' |
| 49 | ++) |
| 50 | +-- |
| 51 | +2.20.1 |
| 52 | + |
0 commit comments