summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/meson/meson/0001-Handle-strings-in-cross-file-args.-Closes-4671.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/meson/meson/0001-Handle-strings-in-cross-file-args.-Closes-4671.patch')
-rw-r--r--meta/recipes-devtools/meson/meson/0001-Handle-strings-in-cross-file-args.-Closes-4671.patch87
1 files changed, 87 insertions, 0 deletions
diff --git a/meta/recipes-devtools/meson/meson/0001-Handle-strings-in-cross-file-args.-Closes-4671.patch b/meta/recipes-devtools/meson/meson/0001-Handle-strings-in-cross-file-args.-Closes-4671.patch
new file mode 100644
index 0000000000..1b1668e4ce
--- /dev/null
+++ b/meta/recipes-devtools/meson/meson/0001-Handle-strings-in-cross-file-args.-Closes-4671.patch
@@ -0,0 +1,87 @@
1From 4818b27894c828a50befc94f1bc9062e89a544ea Mon Sep 17 00:00:00 2001
2From: Jussi Pakkanen <jpakkane@gmail.com>
3Date: Sat, 29 Dec 2018 18:23:36 +0200
4Subject: [PATCH] Handle strings in cross file args. Closes #4671.
5
6Upstream-Status: Backport [6c76ac80173bdc40d35e2d6b802f7950646781dc]
7Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
8
9---
10
11Note that the change to ninjabackend.py does not come from commit
126c76ac80, as it was not corrected until commit 2b22576f. However,
13since that commit is huge and changes a lot of unrelated stuff, it was
14easier to include the relevant part here.
15
16 cross/ubuntu-armhf.txt | 2 +-
17 mesonbuild/backend/ninjabackend.py | 2 +-
18 mesonbuild/compilers/compilers.py | 4 ++--
19 test cases/common/137 get define/meson.build | 12 +++---------
20 4 files changed, 7 insertions(+), 13 deletions(-)
21
22diff --git a/cross/ubuntu-armhf.txt b/cross/ubuntu-armhf.txt
23index fec8ce7..a6e1f15 100644
24--- a/cross/ubuntu-armhf.txt
25+++ b/cross/ubuntu-armhf.txt
26@@ -12,7 +12,7 @@ pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config'
27 root = '/usr/arm-linux-gnueabihf'
28 # Used in unit test '140 get define'
29 c_args = ['-DMESON_TEST_ISSUE_1665=1']
30-cpp_args = ['-DMESON_TEST_ISSUE_1665=1']
31+cpp_args = '-DMESON_TEST_ISSUE_1665=1'
32
33 has_function_printf = true
34 has_function_hfkerhisadf = false
35diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
36index 3739c0a..2cebeef 100644
37--- a/mesonbuild/backend/ninjabackend.py
38+++ b/mesonbuild/backend/ninjabackend.py
39@@ -1400,7 +1400,7 @@ int dummy;
40 if is_cross:
41 crstr = '_CROSS'
42 try:
43- cross_args = self.environment.cross_info.config['properties'][langname + '_link_args']
44+ cross_args = mesonlib.stringlistify(self.environment.cross_info.config['properties'][langname + '_link_args'])
45 except KeyError:
46 pass
47 rule = 'rule %s%s_LINKER\n' % (langname, crstr)
48diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
49index e27ae2b..a5b9e91 100644
50--- a/mesonbuild/compilers/compilers.py
51+++ b/mesonbuild/compilers/compilers.py
52@@ -1048,10 +1048,10 @@ class Compiler:
53 if 'properties' in environment.cross_info.config:
54 props = environment.cross_info.config['properties']
55 lang_args_key = self.language + '_args'
56- extra_flags += props.get(lang_args_key, [])
57+ extra_flags += mesonlib.stringlistify(props.get(lang_args_key, []))
58 lang_link_args_key = self.language + '_link_args'
59 if link:
60- extra_flags += props.get(lang_link_args_key, [])
61+ extra_flags += mesonlib.stringlistify(props.get(lang_link_args_key, []))
62 return extra_flags
63
64 def _get_compile_output(self, dirname, mode):
65diff --git a/test cases/common/137 get define/meson.build b/test cases/common/137 get define/meson.build
66index 109f628..1647e22 100644
67--- a/test cases/common/137 get define/meson.build
68+++ b/test cases/common/137 get define/meson.build
69@@ -67,15 +67,9 @@ foreach lang : ['c', 'cpp']
70
71 run_1665_test = false
72 if meson.is_cross_build()
73- # Can't use an empty array as a fallback here because of
74- # https://github.com/mesonbuild/meson/issues/1481
75- lang_args = meson.get_cross_property(lang + '_args', [])
76- if lang_args.length() != 0
77- foreach lang_arg : lang_args
78- if lang_arg.contains('MESON_TEST_ISSUE_1665')
79- run_1665_test = true
80- endif
81- endforeach
82+ lang_arg = meson.get_cross_property(lang + '_args', '')
83+ if lang_arg == '-DMESON_TEST_ISSUE_1665=1'
84+ run_1665_test = true
85 endif
86 endif
87