summaryrefslogtreecommitdiffstats
path: root/frameworks/wayland/patches/001-fix-wayland-scanner-detect.patch
blob: 8fde3b23499731ca5b50dc5a18d99b665c040e78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- a/src/meson.build
+++ b/src/meson.build
@@ -80,8 +80,12 @@ if get_option('scanner')
 endif
 
 if meson.is_cross_build() or not get_option('scanner')
-	scanner_dep = dependency('wayland-scanner', native: true, version: meson.project_version())
-	wayland_scanner_for_build = find_program(scanner_dep.get_variable(pkgconfig: 'wayland_scanner'))
+	if (get_option('scanner_bin') != '')
+		wayland_scanner_for_build = get_option('scanner_bin')
+	else
+		scanner_dep = dependency('wayland-scanner', native: true, version: meson.project_version())
+		wayland_scanner_for_build = find_program(scanner_dep.get_variable(pkgconfig: 'wayland_scanner'))
+	endif
 else
 	wayland_scanner_for_build = wayland_scanner
 endif
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -6,6 +6,10 @@ option('scanner',
   description: 'Compile wayland-scanner binary',
   type: 'boolean',
   value: true)
+option('scanner_bin',
+  description: 'Path to wayland-scanner binary',
+  type: 'string',
+  value: '')
 option('tests',
   description: 'Compile Wayland tests',
   type: 'boolean',