summaryrefslogtreecommitdiffstats
path: root/meta/classes/meson.bbclass
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-06-13 12:50:45 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-06-18 11:07:57 +0100
commitc76ca2c65b284a1296979bf9365a395163259012 (patch)
tree3644491072968f36597b2f5edf6efcb55f0c34bb /meta/classes/meson.bbclass
parent0de9ceeafc86726a20d1982642b6446935919c7c (diff)
downloadpoky-c76ca2c65b284a1296979bf9365a395163259012.tar.gz
meson: only use lists of commands in cross file if required
There's a bug in Meson[1] where it find_program("foo") will fail if foo is defined in the cross file as a list. This is causing the Meson build of libdrm to fail, but for this instance we can work around the problem by only using lists in the cross file if there are arguments, and just using a string if there are not. [1] https://github.com/mesonbuild/meson/issues/3737 (From OE-Core rev: 7fd8bc469c2caacc1c2021bd0aa83dd6da7fe1e7) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/meson.bbclass')
-rw-r--r--meta/classes/meson.bbclass25
1 files changed, 13 insertions, 12 deletions
diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
index 5881765abb..e572344bd2 100644
--- a/meta/classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -42,7 +42,8 @@ MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross"
42MESON_CROSS_FILE_class-nativesdk = "--cross-file ${WORKDIR}/meson.cross" 42MESON_CROSS_FILE_class-nativesdk = "--cross-file ${WORKDIR}/meson.cross"
43 43
44def meson_array(var, d): 44def meson_array(var, d):
45 return "', '".join(d.getVar(var).split()).join(("'", "'")) 45 items = d.getVar(var).split()
46 return repr(items[0] if len(items) == 1 else items)
46 47
47addtask write_config before do_configure 48addtask write_config before do_configure
48do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS CC CXX LD AR NM STRIP READELF" 49do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS CC CXX LD AR NM STRIP READELF"
@@ -50,21 +51,21 @@ do_write_config() {
50 # This needs to be Py to split the args into single-element lists 51 # This needs to be Py to split the args into single-element lists
51 cat >${WORKDIR}/meson.cross <<EOF 52 cat >${WORKDIR}/meson.cross <<EOF
52[binaries] 53[binaries]
53c = [${@meson_array('CC', d)}] 54c = ${@meson_array('CC', d)}
54cpp = [${@meson_array('CXX', d)}] 55cpp = ${@meson_array('CXX', d)}
55ar = [${@meson_array('AR', d)}] 56ar = ${@meson_array('AR', d)}
56nm = [${@meson_array('NM', d)}] 57nm = ${@meson_array('NM', d)}
57ld = [${@meson_array('LD', d)}] 58ld = ${@meson_array('LD', d)}
58strip = [${@meson_array('STRIP', d)}] 59strip = ${@meson_array('STRIP', d)}
59readelf = [${@meson_array('READELF', d)}] 60readelf = ${@meson_array('READELF', d)}
60pkgconfig = 'pkg-config' 61pkgconfig = 'pkg-config'
61 62
62[properties] 63[properties]
63needs_exe_wrapper = true 64needs_exe_wrapper = true
64c_args = [${@meson_array('MESON_C_ARGS', d)}] 65c_args = ${@meson_array('MESON_C_ARGS', d)}
65c_link_args = [${@meson_array('MESON_LINK_ARGS', d)}] 66c_link_args = ${@meson_array('MESON_LINK_ARGS', d)}
66cpp_args = [${@meson_array('MESON_CPP_ARGS', d)}] 67cpp_args = ${@meson_array('MESON_CPP_ARGS', d)}
67cpp_link_args = [${@meson_array('MESON_LINK_ARGS', d)}] 68cpp_link_args = ${@meson_array('MESON_LINK_ARGS', d)}
68gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper' 69gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper'
69 70
70[host_machine] 71[host_machine]