summaryrefslogtreecommitdiffstats
path: root/meta/classes/meson.bbclass
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2019-12-20 14:57:35 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-12-28 23:25:42 +0000
commitf6a35934540e910794b8729ecc278189a39b710f (patch)
treefc8b6fd4a3c1099abcaaeff9efbea54d69e86c38 /meta/classes/meson.bbclass
parent9fd5fb85468dac57d3b7f9d872ad9cea21ca9e77 (diff)
downloadpoky-f6a35934540e910794b8729ecc278189a39b710f.tar.gz
meson: map the system property in the cross file
We can't just use HOST_OS, as in meta-mingw SDKs that is 'mingw32' but Meson expects 'windows'. (From OE-Core rev: f408bbb1cc72b84905b22d100f52c0a9f54ff3fe) 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.bbclass13
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
index e1a13bbbf7..71f9de1a57 100644
--- a/meta/classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -62,6 +62,15 @@ def meson_cpu_family(var, d):
62 else: 62 else:
63 return arch 63 return arch
64 64
65# Map our OS values to what Meson expects:
66# https://mesonbuild.com/Reference-tables.html#operating-system-names
67def meson_operating_system(var, d):
68 os = d.getVar(var)
69 if "mingw" in os:
70 return "windows"
71 else:
72 return os
73
65def meson_endian(prefix, d): 74def meson_endian(prefix, d):
66 arch, os = d.getVar(prefix + "_ARCH"), d.getVar(prefix + "_OS") 75 arch, os = d.getVar(prefix + "_ARCH"), d.getVar(prefix + "_OS")
67 sitedata = siteinfo_data_for_machine(arch, os, d) 76 sitedata = siteinfo_data_for_machine(arch, os, d)
@@ -97,13 +106,13 @@ cpp_link_args = ${@meson_array('LDFLAGS', d)}
97gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper' 106gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper'
98 107
99[host_machine] 108[host_machine]
100system = '${HOST_OS}' 109system = '${@meson_operating_system('HOST_OS', d)}'
101cpu_family = '${@meson_cpu_family('HOST_ARCH', d)}' 110cpu_family = '${@meson_cpu_family('HOST_ARCH', d)}'
102cpu = '${HOST_ARCH}' 111cpu = '${HOST_ARCH}'
103endian = '${@meson_endian('HOST', d)}' 112endian = '${@meson_endian('HOST', d)}'
104 113
105[target_machine] 114[target_machine]
106system = '${TARGET_OS}' 115system = '${@meson_operating_system('TARGET_OS', d)}'
107cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}' 116cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}'
108cpu = '${TARGET_ARCH}' 117cpu = '${TARGET_ARCH}'
109endian = '${@meson_endian('TARGET', d)}' 118endian = '${@meson_endian('TARGET', d)}'