summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2019-11-05 23:08:31 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-11-18 14:42:12 +0000
commit8855a1ec4de0762038590ff06355af7ba8beea29 (patch)
treeede54e4fa0c8da439ef13dae846a02c8d1775c3d /meta
parent40ca39df1b8de8ca476c9085442dbc58fb57abb3 (diff)
downloadpoky-8855a1ec4de0762038590ff06355af7ba8beea29.tar.gz
meson: Backport patch to handle strings in cross file args
This allows <language>_args and <language>_link_args properties, e.g., c_link_args, in meson.cross to be specified as either a string or a list. (From OE-Core rev: 1913e688ad95d465e9b9d16ad57f2bdef2b50d93) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/meson/meson.inc1
-rw-r--r--meta/recipes-devtools/meson/meson/0001-Handle-strings-in-cross-file-args.-Closes-4671.patch87
2 files changed, 88 insertions, 0 deletions
diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc
index bfe9851e94..ef26848498 100644
--- a/meta/recipes-devtools/meson/meson.inc
+++ b/meta/recipes-devtools/meson/meson.inc
@@ -17,6 +17,7 @@ SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${P
17 file://many-cross.patch \ 17 file://many-cross.patch \
18 file://cross-libdir.patch \ 18 file://cross-libdir.patch \
19 file://0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch \ 19 file://0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch \
20 file://0001-Handle-strings-in-cross-file-args.-Closes-4671.patch \
20 " 21 "
21SRC_URI[sha256sum] = "ef9f14326ec1e30d3ba1a26df0f92826ede5a79255ad723af78a2691c37109fd" 22SRC_URI[sha256sum] = "ef9f14326ec1e30d3ba1a26df0f92826ede5a79255ad723af78a2691c37109fd"
22SRC_URI[md5sum] = "0267b0871266056184c484792572c682" 23SRC_URI[md5sum] = "0267b0871266056184c484792572c682"
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