blob: e638fd3b6f3c23f6a856d56be5e06ba2b27c4e03 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From bf71999b6e64d1f1919b0351b27c1c417e2b8856 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Thu, 14 Feb 2019 18:06:25 +0100
4Subject: [PATCH] Generate loaders.cache using a native tool when
5 cross-compiling
6
7Otherwise meson would attempt to run a target binary.
8
9Upstream-Status: Pending
10Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
11
12---
13 gdk-pixbuf/meson.build | 13 +++++++++++++
14 1 file changed, 13 insertions(+)
15
16diff --git a/gdk-pixbuf/meson.build b/gdk-pixbuf/meson.build
17index 1995ffd..d692cb7 100644
18--- a/gdk-pixbuf/meson.build
19+++ b/gdk-pixbuf/meson.build
20@@ -291,6 +291,7 @@ foreach bin: gdkpixbuf_bin
21 set_variable(bin_name.underscorify(), bin)
22 endforeach
23
24+if not meson.is_cross_build()
25 # The 'loaders.cache' used for testing, so we don't accidentally
26 # load the installed cache; we always build it by default
27 loaders_cache = custom_target('loaders.cache',
28@@ -302,6 +303,18 @@ loaders_cache = custom_target('loaders.cache',
29 ],
30 build_by_default: true)
31 loaders_dep = declare_dependency(sources: [ loaders_cache ])
32+else
33+loaders_cache = custom_target('loaders.cache',
34+ output: 'loaders.cache',
35+ capture: true,
36+ depends: [ dynamic_loaders_dep ],
37+ command: [
38+ 'gdk-pixbuf-query-loaders',
39+ dynamic_loaders,
40+ ],
41+ build_by_default: true)
42+loaders_dep = declare_dependency(sources: [ loaders_cache ])
43+endif
44
45 pkgconfig = import('pkgconfig')
46 pkgconfig.generate(